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

Is it safe to assume this?

Hi all,

I am wondering if the following is safe to assume always true.

http://*{Id} to reference a particular record in the database?
No. You should use the URL patterns returned by the describe call.
I am sorry, but I don't understand exactly what you mean by
"use the URL patterns returned by the describe call"?

I wrote the following function to get the reference of my previous record from my s-control. Is this good or ok or really bad idea?

function getIDFromURL(){
    var url = window.parent.parent.document.referrer;
    var id = url.substr(url.indexOf(".com/") + 5);
    if(id.indexOf("/") != -1)
        id = id.substr(0, id.indexOf("/"));
    return id;
the describeSObject call returns a number of URLs that can be used to build URLs to that type of object.

not every object in the system uses the *{id} format for its urls. wouldn't you be better off having the Id explicitly passed via a merge field ? your code will fail if the user bookmarks your scontrol.
merge field method doesn't necessary work for me, because user might not access my s-control directly from custom links from the associated record.

Hi Simon,
Do you have an example of an object that does not follow this pattern?
Gareth DaviesGareth Davies
Have a look at: Message 3354 Hope that helps. Gareth.

Message Edited by Gareth Davies on 04-03-2006 12:17 PM