I am using the Spring '20 feature Navigate to a Record’s Create Page with Default Field Values to create a detail page URL button on the Account page called "New Opportunity". It prepopulates the new opportunity input page with account fields.
It fails when I try to add a user lookup field (Lead CRE) it fails (running as System Administrator): When Lead CRE is not blank: You don't have access to this record. When Lead CRE is blank: Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 88067341-27787 (-1065292068)
The working url is:
/lightning/o/Opportunity/new?defaultFieldValues=Name=.,Opportunity_Country__c={!Account.Institution_Country__c},Overseas_Office__c={!Account.Overseas_Office__c},AccountId={!Account.Id},Status_Date__c={!TEXT(TODAY())},CloseDate={!TEXT(ADDMONTHS(TODAY(),3))},StageName=Early Stage
The failing URL is:
/lightning/o/Opportunity/new?defaultFieldValues=Name=.,Opportunity_Country__c={!Account.Institution_Country__c},Overseas_Office__c={!Account.Overseas_Office__c},AccountId={!Account.Id},Status_Date__c={!TEXT(TODAY())},CloseDate={!TEXT(ADDMONTHS(TODAY(),3))},Lead_CRE__c={!Account.Lead_CRE__c},StageName=Early Stage
I also confirmed:
- User sharing internal and external are both Public
- No active Process Builder process sets this field. (I had a Process that would copy Lead CRE after saving an opportunity, which worked. But I deactivated the process in order to debug this url button.)
- Field security settings of the Lead CRE field in both account and opportunity are set to Editable
- I created the account, opportunity and user myself
- It does not accept if I try to use Account.Lead_CRE__r.Id instead
- Shortening the URL by removing a few of the fields had no effect so it is not an URL length issue
- I can set the opportunity's Lead CRE field with a user id in general. This works: Lead_CRE__c={!$User.Id} —> Works
- I can set a text field on the opportunity with the account's Lead CRE field. This works: EXT_ID__c={!Account.Lead_CRE__c} —> Works, is set to user’s full name
** EDIT ** I tried sending it to another server to see the url since when in salesforce you cannot see what is being called. (if there is a way to see the parameters being sent to the javascript:void() call please let me know. The url is:
http://mydomain.com/?Name=.,Opportunity_Country__c=U.K.,Overseas_Office__c=NAM+UK,AccountId=0010l00000cvc3F,Status_Date__c=2020-12-11,CloseDate=2023-12-11,CurrencyIsoCode=GBP,%20Office_in_Charge_of_the_Client__c=NAM+UK,Lead_CRE__c=MyLastName+MyFirstName
So it is braindeadly sending the full name...