You need to sign in to do that
Don't have an account?

S-Control to retrieve Tab Name/Context
Is there a way using an S-Control/Javascript to retrieve the Tab name that I'm on?
I have a common functionality that relies on data that must be retrieved different depending if I'm on the Account, Case, or Opportunity tabs.
Dave
See if this helps:
var str=parent.frames.location; str+=""; var startPos=str.search("com/"); var objPrefix=str.substring(startPos+4,startPos+7); var objName; switch (objPrefix) { case("001"):objName="Account";break; case("006"):objName="Opportunity";break; case("500"):objName="Case";break; } alert(objName);
All Answers
See if this helps:
var str=parent.frames.location; str+=""; var startPos=str.search("com/"); var objPrefix=str.substring(startPos+4,startPos+7); var objName; switch (objPrefix) { case("001"):objName="Account";break; case("006"):objName="Opportunity";break; case("500"):objName="Case";break; } alert(objName);
I should have posted our solution, but it is essentially what you have provided.
Thanks!