You need to sign in to do that
Don't have an account?

New Custom Button that will populate the name with the name of the Parent Record
I have created a button call New Metric that I want to use to create a new record and to pre-populate the Name field. The object where the record is created is called RFP Metrics. RFP Metric is a Master-Detail relationship with an object called RFP Tracking. I am creating the record from the RFP Tracking record where RFP Metrics is a related list. The button uses OnClick Java script. Here is the code:
location.href = "a6t/e?Name={!RFP_Metrics__c.Related_RFP_Tracking__c}&CF00N70000003UZ6F={!RFP_Metrics__c.Related_RFP_Tracking__c}&CF00N70000003UZ6F_lkid={!RFP_Metrics__c.Related_RFP_TrackingId__c}&retURL={!RFP_Metrics__c.Link}"
It looks like the Name should populate the the Name of the related record. And because this is a Master-Detail relationship, it should populate the Related Record Id. When I click the button, a new record is created but nothing is populated. When I look at the URL after I clicked the button, it appears like this:
https://na5.salesforce.com/a6t/e?Name=&CF00N70000003UZ6F=&CF00N70000003UZ6F_lkid=&retURL=
It removes all of the merge field information. I have looked all across the internet and I can't figure out why this isn't working.
location.href = "a6t/e?Name={!RFP_Metrics__c.Related_RFP_Tracking__c}&CF00N70000003UZ6F={!RFP_Metrics__c.Related_RFP_Tracking__c}&CF00N70000003UZ6F_lkid={!RFP_Metrics__c.Related_RFP_TrackingId__c}&retURL={!RFP_Metrics__c.Link}"
It looks like the Name should populate the the Name of the related record. And because this is a Master-Detail relationship, it should populate the Related Record Id. When I click the button, a new record is created but nothing is populated. When I look at the URL after I clicked the button, it appears like this:
https://na5.salesforce.com/a6t/e?Name=&CF00N70000003UZ6F=&CF00N70000003UZ6F_lkid=&retURL=
It removes all of the merge field information. I have looked all across the internet and I can't figure out why this isn't working.
The only downsides of using a publisher action is 1. You need to be using Chatter and 2. It creates the record vs taking them to an edit page and pre-filling the fields. That means any fields you want to user to modify needs to be on the publisher action layout.
Your only other option is to use visualforce but that's typically overkill for most use cases.