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
XXXXXX 

Can I Default the Parent ID on a Child Record?

I have two custom objects in a master-detail relationship. I have a custom button on the parent that creates a specific instance of the child object, with appropriate defaulting. The defaults are working, finally -- this was amazingly hard, is this documented anywhere? -- but for some reason I cannot default the parent ID on the child record.

 

Is this possible?

 

Here's the syntax for the custom button:

 

{!URLFOR($Action.License__c.New)}&00N80000003KBfL=1&00N80000003KBSF={!TODAY() + Package__c.Trial_Days__c}&00N80000003KBQT={!Package__c.Id}

 

Am I doing something wrong? The parent ID is Package__c.Id. (This doesn't use the standard URLFOR syntax because my custom fields start with a zero.)

 

TIA,

 

John

Best Answer chosen by Admin (Salesforce Developers) 
XXXXXX

This worked:

 

{!URLFOR($Action.License__c.New)}&00N80000003KBfL=1&00N80000003KBSF={!TODAY() + Package__c.Trial_Days__c}&CF00N80000003KBQT={!Package__c.Name}

 

Is this stuff documented anywhere?

All Answers

XXXXXX

This worked:

 

{!URLFOR($Action.License__c.New)}&00N80000003KBfL=1&00N80000003KBSF={!TODAY() + Package__c.Trial_Days__c}&CF00N80000003KBQT={!Package__c.Name}

 

Is this stuff documented anywhere?

This was selected as the best answer
IntuitivIntuitiv
I agree, it would be more than useful!!