Another Salesforce blog!!!

Salesforce, Apex

April, 2016

Salesforce: Service console page – opening in a sub-tab

VFP: <apex:commandButton onclick=”openTab(‘{!case.id}’); return false;” value=”My awesome page” /> Javascript: <script> var openSecondaryTab = function openTab(objectId) { url = ‘/apex/mypage’; url = url+’?caseId=’+objectId; if(!sforce.console.isInConsole()) window.parent.location.replace(url ); else sforce.console.getEnclosingPrimaryTabId(function(result) { var recordname =name; sforce.console.openSubtab(result.id, url , true, recordname,null); }); }

Selector using contain Id in Jquery

function detailTRSelected() { $(“[id*=’parent’]”).click(function(){ $(this).addClass(“selected”).siblings().removeClass(“selected”); }); }

Selector using Class in JQuery

$.each($(‘.thePanel’), function() { var myid = this.id; });

Jquery Selectors

Following are the Jquery selectors: ^= is starts with $= is ends with = is exactly equal != is not equal *= is contains