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
Fred13Fred13 

Payload for c.force:editRecord

I am using a Salesforce Lab app named Enhanced Data Grids.  It allows you to build sortable data grids.  Part of the functionality allows you to add actions to the lighting component.  I am struggling to build an edit event for the rows.   I am using e.force:editRecord as the event.  You can select the action type (which I selected Row Button)  Finally, there is a section for Event Payload.  The help syntax for Event Payload indicates:  Payload for this event.  For LIST activation, will automatically replace #parentrecordId# with valid id.  For ROW actions, will automatically replace fieldnames with # at beginning and end with the corresponding values.  example:{"recordId":"#Id#")

I am struggling on the correct syntax to allow the edit page to open for the related row in the list.  

Any help would be greatly appreciated!  thanks!

Fred

 
Best Answer chosen by Fred13
Benoy VmBenoy Vm
Please try the following...

Event Payload  -   {"recordId": "#Id#"}
and change the event from c.force:editRecord to e.force:editRecord
 

All Answers

Benoy VmBenoy Vm
Please try the following...

Event Payload  -   {"recordId": "#Id#"}
and change the event from c.force:editRecord to e.force:editRecord
 
This was selected as the best answer
Fred13Fred13
Thank you very much!!!!  Can you also advised if there is a way of passing the recordtypeId when using e.force:createRecord where I'm not using the hardcoded ID?  I know its not good practive to hardcode the ID's but unsure about how else to pass them.  Currently, I'm using:

{"entityApiName":"Opportunity","defaultFieldValues" :{ "AccountId": "#parentrecordid#", "RecordTypeId":"01239000000HrXEAA0", "Name":"Temp Name", "Region__c":"Inernational"}}
 
Jagannath Birajdar 18Jagannath Birajdar 18
@Fred13

See below you have to use " "defaultFieldValues" : " twice. It worked for me. 

{"entityApiName":"Opportunity", "defaultFieldValues" : {"Account__c":"#parentrecordId#"} , "defaultFieldValues" : {"RecordTypeId":"01239000000HrXEAA0"}}
 
Imran Hoque 12Imran Hoque 12
Hello

I am trying to create a Delete button on the related list and have followed the below steps

User-added image

I can see the button against the row but when i click nothing happens?
Samuel ArzurSamuel Arzur
Hi :))

Any news on the delete button ? Doesn't work for me either 

Thnaks