Get the View Page ID from a related record

Posted by IramK on 26-May-2015 05:13

Hello,

I have a situation where I have a relationship between two objects (A-B) (1-M) and I would like to get the view page ID of a record in object A such that when I create a new record in object B from the View page of record A, I can perform certain tasks pertaining to where I come from. Could you possibly suggest as to how I can detect which view page I am coming from? Looking forward to your suggestions.

Cheers.

All Replies

Posted by Gian Torralba on 26-May-2015 10:27
Hello,

What do you want to do with the view page ID? Do you want to store it in a record of object B? In a view page, you can look into the url and you will see the pageID parameter. The parameter's value can also be seen if you go to the object definition page > pages > click the view page link and will see the view page id at the bottom part of the screen. You can extract the pageID value by using a javascript code that extracts the parameter value. Put the script in the page you want to extract the parameter value from.

Hope this helps.

Thank you,
Gian
Posted by IramK on 26-May-2015 10:32

That's fine that I can extract it from the url parameter on the view page of record A, but lets say I am creating a new record for Object B from the view page of Object A. How can I then know from the object A's new record page, the view page id of the record where I am coming from?

Posted by Gian Torralba on 28-May-2015 12:52
Hello,

What you can do is create a new button that will replace the new button link and pass the url from view page A and then add a param e.g (
Posted by IramK on 29-May-2015 05:07

Could you please post the complete answer?

Cheers.

Posted by Gian Torralba on 01-Jun-2015 12:28
Hello,

May I ask first what exactly are you planning to do? Do you want to replace the default new button on the list view? Or do you want to create your own new button?

Thanks,
Gian
This thread is closed