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
Vijay BirsinghVijay Birsingh 

AccountId field ID to add to URL

Hello to you all,
                      I am developing a custom button New Asset -which will be added in the Asset related list on my Habitat custom object- to access the New Asset standard page. But I am not able to retrieve the AccountId related to the Habitat object in the button's URL as a parameter, so that when I go to the New Asset page, it pre-fills the Asset.AccountId field. Could you please help me on how to pass the AccountId as a parameter so that I can get the Asset.AccountId field pre-filled from the Habitat.AccountId field?

I thank you.

Regards,
Vijay.

Best Answer chosen by Vijay Birsingh
Shivram SainiShivram Saini
Hi Vijay,

You can pass the AccountId and Account Name as parameter in URL as given below:
Account={!Habitat__c.Account__c}&Account_lkid={!Habitat__c.AccountId__c}

This way Asset.AccountId field will be pre-filled.

Thanks

All Answers

Shivram SainiShivram Saini
Hi Vijay,

You can pass the AccountId and Account Name as parameter in URL as given below:
Account={!Habitat__c.Account__c}&Account_lkid={!Habitat__c.AccountId__c}

This way Asset.AccountId field will be pre-filled.

Thanks
This was selected as the best answer
Vijay BirsinghVijay Birsingh

Hey Shivram,
                            I thank you for your help. It works!

 

Regards,
VIjay.