You need to sign in to do that
Don't have an account?
pathworks
How to use the organization ID in a formula field?
I need to use a formula field to build a hyperlink, part of which must be the current user's organization id. Something like this: HYPERLINK("urlhere/instance/" & {!OrgId}).
In both the Simple and Advanced formula editors, there is no choice for OrgId as a field. It is also not available as a function. I get an error if I try to include it using {!OrgId} or any other syntax I can think of.
Less important, but also odd: I don't see an equivalent of the API 7.0 Server URL either. I just see GETSESSIONID(). Seems you should have access to the same fields as when defining a custom link. or web tab. I need to use the session id to go back and validate a single-sign-on request, and am currently having to hard-code na1.ambientsoftware.com, which is not a good thing.
- Dan
You will need to use the getsessionid field to pass the session id to your server, then parse the referrer url to get the salesforce.com instance the customer is homed on and use that for the soap endpoint.
ie: if the referrer url is https://na3.salesforce.com/003000000l3kk or something like that, you will need to turn that into https://na3.salesforce.com/services/Soap/u/7.0.
With the session id and ther endpoint url, you can now make a query against the organization object to obtain the org id.
Thanks, that makes sense. My one concern, besides the amount of code and the extra servlet it will take on our side, is the performance implications. The net result of all this is just to display an image based on a third party service's data, for a composite application. This solution means that the client browser has to make a request of our service, we have to then authenticate them and get user info from salesforce.com, then have to look up in the data based on the organization id in our database, and then return the data to the browser. I'll have to see how much latency the extra round trip to salesforce.com costs us - seems like it might be a noticeable delay.
I'd like to suggest an enhancement to include the server url and organization id as available fields, and whatever else is needed to bring it to parity with custom tabs and s-controls.
Dan