+ Start a Discussion

Dynamic Identification of Object Type

I have a S-Control which is loaded everytime  a record detail page gets re/loaded. It is common to all the objects viz Account,Oppty etc. Is there any way to capture or know from which record detail page the S-control is fired.
For Example : Oppty 1 and Account 1 fires the S-control one after the other. How can the control know whether it's the Account or the Opportunity page that got re/loaded.
When tried "window.location.toString()" within the control;it is returning the S-Control URl not the detail page URL i.e "https:// na2.salesforce.com/001......"
Thanks and Regards,
Dinesh Nasipuri.

actually, in this case salesforce put the S-control in an iframe(view the corresponding page source). So use 'parent.location' instead of 'location'.

Greg HGreg H
You could look at the parent.location.href to determine the first three characters of your record Id.  by calling the parent you would be looking at the detail page URL and not the sControl URL.  You'd then have to do some logic to determine if the record Id begins with "001" or "006".