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
Jennifer.SchnellJennifer.Schnell 

What am I missing? Custom Button

I created a custom button (URL) to sit on a related list in a contact record.  When you click that button it is suppose to create a new record in that related custom object and populate a field from a custom contact field.  Below is what I have but it isn't working.
 
/a78/e?01I19000000Criu={!Contact.Contact_Full_Name__c}
Best Answer chosen by Jennifer.Schnell
karthikeyan perumalkarthikeyan perumal
Hello, 

Use blow code for this 


Method 1: Do something like this, 


/a78/e?CF00Ni000000EpsgO={!Opportunity.Name}&CF00Ni000000EpsgO_lkid={!Opportunity.Id}&00Ni000000EpsgY={!Opportunity.Description}
 
Or inf you have any complex foollow the URL

http://forcewizard.com/blog/url-hack-prepopulate-lookup-fields-parent-data

Method 2:

Via URLFOR,

{!URLFOR( $Action.Child_Object_Name__c.New , null, [saveURL=Parent_Object_Name__c.Link, retURL=Parent_Object_Name__c.Link, CF00NE0000002aLV0_lkid=Parent_Object_Name__c.Id , CF00NE0000002aLV0=Parent_Object_Name__c.Name])}

Example I did it for  Opp nad Account, 

{!URLFOR($Action.Opportunity.New , null, [saveURL=Account.Link, retURL=Account.Link, CF00NE0000002aLV0_lkid=Account.Id , CF00NE0000002aLV0=Account.Name])}



Hopw this will help you, 

Thanks
karthik
 

All Answers

karthikeyan perumalkarthikeyan perumal
Hello, 

Use blow code for this 


Method 1: Do something like this, 


/a78/e?CF00Ni000000EpsgO={!Opportunity.Name}&CF00Ni000000EpsgO_lkid={!Opportunity.Id}&00Ni000000EpsgY={!Opportunity.Description}
 
Or inf you have any complex foollow the URL

http://forcewizard.com/blog/url-hack-prepopulate-lookup-fields-parent-data

Method 2:

Via URLFOR,

{!URLFOR( $Action.Child_Object_Name__c.New , null, [saveURL=Parent_Object_Name__c.Link, retURL=Parent_Object_Name__c.Link, CF00NE0000002aLV0_lkid=Parent_Object_Name__c.Id , CF00NE0000002aLV0=Parent_Object_Name__c.Name])}

Example I did it for  Opp nad Account, 

{!URLFOR($Action.Opportunity.New , null, [saveURL=Account.Link, retURL=Account.Link, CF00NE0000002aLV0_lkid=Account.Id , CF00NE0000002aLV0=Account.Name])}



Hopw this will help you, 

Thanks
karthik
 
This was selected as the best answer
Jennifer.SchnellJennifer.Schnell
Thank you @karthik  Much appreciated.