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
Sean DaggerSean Dagger 

Global ObjectType values

I have built an online help scontrol that overrides the SalesForce help link.  What I want to do is open a new window with the help documentation depending on the object type.  for example, If you are in the account (clients) screens, clicking the help link opens help for that area.  If you are in the development screens (opportunities), clicking help opens help for that area and so on. 

I can do the scontrol to detect which type of client is logged on using the {!$Profile.Name} object but I cannot find how to detect which object the user is current in.  I want to get the values:

001 for Account, 003 for Contacts, a09 for Developments etc.   If variableX = 001 redirect to url nnn,  If variableX = 003 redirect to yyy

Can anyone help me on how to obtain this value?  Is there a global variable for the ObjectType object?

Thanks to anyone who can help.
Greg HGreg H
You could parse the URL.  If you're on the default tab for the object it will be between two forward slashes and if your on a specific record it will be the first three characters of the record id in the URL.
-greg
Sean DaggerSean Dagger
Thank you for your reply.  I did think of that after I posted the question but I then hit another snag. 

The only way you can override the standard help link on the page is by specifying a url scontrol within set-up.  I have set the url to point to an scontrol where I can then write code to determine the object.

If I call the document.href - the url is the scontrol url, If I call the document.referrer - the url is the scontrol that calls the scontrol.  so I am not sure if I can get the url containing the object id?  Can I pass this information as a variable with the url scontrol?  Or better still, access a global variable with this value?



Message Edited by Sean Dagger on 02-01-2008 12:47 AM