I'm trying to create a custom button to create a new custom object record. My aim is to use it from my custom object "restricted fund" and create a new "restricted fund payment due" record, automatically populating the record with its name, the name of the related parent record and the account name of the parent record. Using an existing button as a template I've written:

/a0X/e?retURL=%2Fa0X%2Fo  &Name=Payment_{!CASE  (Restricted_Fund__c.Number_of_Payments_Due__c,  1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,1)}_{!Restricted_Fund__c.Name}  
&00N0N00000Gplsw=Contingent  &CF01I0N000000hyx3_lkid={!Restricted_Fund_Payment_Due__c.Restricted_Fund_PaymentId__c}  
&0000N0N00000GpltL={!CASE ( Restricted_Fund__c.Number_of_Payments_Due__c ,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15,16,1)}  &CF00N0N00000GplsS_lkid={!Restricted_Fund__c.Organisation_restricted_fundId__c}  

So far so good but when I deploy it and click on it, nothing happens. any ideas of where I'm going wrong?

  • You mean it is working in your sandbox, But not in production? Oct 23, 2018 at 12:46
  • IDs used in a sandbox won't be the same in the target (deployment) org.
    – cropredy
    Oct 23, 2018 at 18:15
  • Hi both. I'm working direct in my SF instance. I've used an existing button as a template and can't see where I'm going wrong. I wonder if its something in the first string /a0X/e?retURL=%2Fa0X%2Fo. /aOX/o is the location of the new record I'm trying to launch and populate. /a0X/e?retURL=%2Fa0X%2Fo is the string I get when I create a new record. Oct 25, 2018 at 11:04

1 Answer 1


Sounds like a perfect occasion to use a custom action on "restricted fund" with Action Type "Create a record". That way you can set your values as Predefined Field Values.

  • Thanks for the suggestion. I successfully created an action, but want some fields to be pre-filled (using existing relationships between objects). Is it possible to do that Oct 25, 2018 at 11:16
  • Yes, with the mentioned "Predefined Field Values". If you go to Setup->*Your Parent Object*->'Buttons, Links, and Actions' and click on the label your action of type 'Create a Record', you'll get an overview of the action and below that the area 'Predifined Field Values'. (This is Lightning, might be slightly different in Classic)
    – Schnaps
    Oct 25, 2018 at 14:15
  • Hi @DebbiePippard, did that work out?
    – Schnaps
    Nov 28, 2018 at 7:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .