function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
NasipuriNasipuri 

Dynamic Identification of Object Type

Hi,
 
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.
srijansrijan

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".
-greg