You need to sign in to do that
Don't have an account?
Javascript to find details on the Object of the current screen and related list
I have a home page component that can add notes/tasks to the current object in the detail page. I need find out through the Javascript what the current object is and if the sharing model allows the user to add notes/tasks and whether the object has notes/tasks (custom objs) . Right now this is all Javascript...no APEX and hoping to keep it that way if I can for the moment so if it is just a few calls in JS then good. Otherwise I am ok to do with JS/APEX if need be.
Can anyone point me in the right direction?
p.s. I see the
SELECT RecordId FROM UserRecordAccess
code but worried about a lot SOQL hits since this component could get driven by screen refreshes.
You should ccess URL in JS and find id and profix which will let you know object type and then you can use Soforce.connection SOQL toget complete information.
S - yes already have the url and have done some checking for prefix where necessary but I woul like to make it more generic...as I said, I see the SOQL call....just wishing I didn't have to add the overhead.
Hi,
See the link, it has the Prefixes of Standard Objects which appear in the URL, this can help you query and catagotrize the object record page.
http://www.us-techpro.com/2012/06/key-prefixes-of-standard-objects-in.html
Regards,
Ashish