0

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...

1

In Salesforce for lookup fields we got 2 option.The first one will give you Name field data and second will return you Id. In your case you are using first which is giving Name, thats why it is not working for lookup but working fine for text field. So in your case you need to use {!Account.Lead_CREId__c} and you will get id and it will work for you.

  1. {!Opportunity.demo_User__c}
  2. {!Opportunity.demo_UserId__c}
1
  • 1
    Thank you! I didn't realize that. I actually saw the Lead_CREId__c but that field did not show up in the Fields panel so I thought there was something wierd going on. Now I understand there is indeed something wierd but it is a good wierd. Many thanks. – skycafe Dec 11 '20 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.