We are using the app 'Sortable Data Grids' which works well. We have an event payload when creating a new record which pre-populates a lookup field (Programme__c) with the #.parentrecordId# and this works as expected:
{"entityApiName":"Eth_Programme_Event__c", "defaultFieldValues":{"Programme__c":"#.parentrecordId#"}}
We want to also pre-populate a look up field for Users (Assigned_staff__c) so the default is the current logged in user. I've tried userInfo.getUserId() and $SObjectType.CurrentUser.Id (for example the below code) but we get an error when clicking to add a new record using this event:
{"entityApiName":"Eth_Programme_Event__c", "defaultFieldValues":{"Programme__c":"#.parentrecordId#", "Assigned_staff__c":"userInfo.getUserId()"}}
Any idea how to reference the current user in an event payload?
Many thanks!
답변 1개
On further investigation I suspect this is a limitation of Sortable Data Grids / Enhanced Lightning Grid... I'll ask the Salesforce Lab team...
https://appexchange.salesforce.com/servlet/servlet.FileDownload?file=00P3A00000aW6whUAC