I have a custom object called Custom_Request__c with several record types. We have a custom lightning button on the opportunity product object to create a record of Custom_Request__c of recordtype "AMS Request". While creating a new record of Custom_Request__c object with "AMS Request" record type, we are autopopulating several fields from the Opportunity, Account and Opportunity Product and everything works fine.
Below is the code of the lightning button that is working.
/lightning/o/Custom_Request__c/new?recordTypeId=0127ZxxxxxxxxxQAK&defaultFieldValues=Name="Name will be calculated automatically",Account__c={!Opportunity.AccountId},Opportunity__c={!Opportunity.Id}
Now, I have created another custom lightning button to create the Custom_Request__c record of record type "AMS Dashboard". The button for creating this record will be on the Custom_Request__c record of "AMS Request" record type. I have created a custom lookup field called "Related Parent Request" on the Custom_Request__c object. The lightning button code is below.
/lightning/o/Custom_Request__c/new?recordTypeId=0127ZyyyyyyyyyQAK&defaultFieldValues=Name="Name will be calculated automatically",Account__c={!Custom_Request__c.Account__c},Opportunity__c={!Custom_Request__c.Opportunity__c},Related_Parent_Request__c={!Custom_Request__c.Id}
However, the above button code is NOT working. When I click on the button "AMS Dashboard" on the Custom Request record, the window popup opens, but except the Name field and Related_Parent_Request__c, nothing else is populating. The Account and Opportunity information for the new record should be taken from the Custom Request record of the "AMS Request" record type, but it is not happening. Moreover, the Account and Opportunity fields are NOT showing up on the new button. When I remove the Account__c from the lightning button code, it shows up in the "New" page layout. Once I add back the code Account__c={!Custom_Request__c.Account__c}, it disappears from the "New" page layout. FYI, I have tried with nooverride=true also and it doesn't help either.
Can someone help?
Custom_Request__c
fields, but theCustom_Request__c
won't exist yet. Won't that by why they're not populating? i.e. WhichCustom_Request__c
would that URL be using?