Closed ashishsutar123 closed 1 year ago
Hi Ashish -- My sandbox is on the Winter 21 release, and my create new record actions are selecting the record types appropriately.
Thanks @jeremyjpalmer for replying, Just to confirm, You are referring to data grid action buttons, correct?, and there in you have pre-defaulted a different record type?
@ashishsutar123 Yes, my buttons create records with different record types. They works fine. The only thing that could be improved is that the new record popup window title mentions the default record type name (i.e., "New [Object]: [Default Record Type]", which is incorrect), but the Record Type field value is correct. Having the record type on the page layout is helpful.
We are having the same issue as @ashishsutar123 Our org was updated over the weekend to Winter 21 and now the action button is not opening the correct record type - it only opens the default record type.
This is our definition in the event payload. {"entityApiName":"CustomObjectc","defaultFieldValues":{"Opportunityc":"#parentrecordId#","RecordTypeId":"012f4000000yvS4AAI"}}
Anyone have any suggestions on how to fix? Thanks
Try this as a fix --add the following at the end of the payload, before the last "}": , "navigationLocation": "LOOKUP"
Thanks for the suggestion. But, it didn't fix the issue. FYI - it's a List Button with event e.force:createRecord {"entityApiName":"CustomObjectc","defaultFieldValues":{"Opportunityc":"#parentrecordId#","RecordTypeId":"012f4000000yvS4AAI"}, "navigationLocation": "LOOKUP"}
@ndemers-wk I'm able to replicate your issue when I remove "navigationLocation": "LOOKUP", but adding it back in fixes it for me. You might also try to log out and log back in to ensure that your arent caching the old version.
Wait..... It did work. I moved to the beginning {"entityApiName":"Client_Accessc", "navigationLocation": "LOOKUP","defaultFieldValues":{"Opportunityc":"#parentrecordId#","RecordTypeId":"012f4000000yvS4AAI"}} Or maybe I was an idiot and didn't see it last time. The title of the record is incorrect, but the correct RecordType is presented.
I will test with LOOKUP at the beginning and at the end... and let you know the results. THANKS!!
@jeremyjpalmer You're a genius. Thanks. Adding to the beginning or end works. I just missed it the first time. Life is good. Thanks again.
@ndemers-wk We had the same problem as you re the RecordType not being set correctly. We found a solution that was pretty simple and figured I'd share here just in case! Turns out we just needed to include the RecordTypeId
in the parent payload object by setting a recordTypeId
key rather than including it our defaultFieldValues
key. Doing that fixed all our problems and has also fixed the display of the title of the record too! 🎉
We tried the "navigationLocation": "LOOKUP"
fix above which did work, but it was super troublesome for our users to have the wrong title so I dug a bit further.
Before in our Event Payload field we had this, which wasn't working and was behaving exactly like your original issue.
{ "entityApiName": "CustomObject__c", "defaultFieldValues": {
"OpportunityId__c": "#parentRecordId#", "RecordTypeId": "0122P0000004IlSQAU"
} }
We then changed it to this, which now works perfectly and sets the record title correctly :)
{ "entityApiName": "CustomObject__c", "recordTypeId": "0122P0000004IlSQAU", "defaultFieldValues": {
"OpportunityId__c": "#parentRecordId#"
} }
One thing is don't forget the casing on recordTypeId
needs to be camelcased that way for it to work when moving it to the parent level, including it as RecordTypeId
won't work.
Hope this is helpful!
Thanks. Very helpful!
It would be nice to use Record Type Developer Name instead of Id, but that is just a wish list item really.
Closed based on the comments above
Hi Team,
We are using this grid application for our project. Recently we observed that post Winter'21 release the grid is malfunctioning. We have create new record action created on this grid related list, in this actions we have defaulting some of the values of the new record including record type, which was working fine but all of the sudden post the new release the actions have stopped picking the record type that is defined in the grid's create record action and are picking master record type as a default one. This is happening in all the the sandboxes that have got upgraded to the winter'21 release.
Would like to know in case we are aware about this issue and if we have any solution or workaround for this.
Your help would be really appreciated.
Regards, Ashish Sutar