0

I have this button I created in a sandbox:

/lightning/o/Correction__c/new?&defaultFieldValues= Audit_Finding__c={!URLENCODE(Audit_Finding__c.Id)}, Origination__c={!IF(TEXT(Audit_Finding__c.Scope__c) != "Corporate", TEXT(Audit_Finding__c.Origination__c), null)}, Origination_Entity__c={!IF(TEXT(Audit_Finding__c.Scope__c) != "Corporate", TEXT(Audit_Finding__c.Origination_Entity__c), null)}, Title__c={!Audit_Finding__c.Title__c}

This is working fine when i click my button i have the fields prefiled:

enter image description here

However I deployed in production my fields are not filled automatically. I checked the profiles rights on the fields I'm using in the URL and I have access to them (read and edit).

The button is the same, fields are the same (I checked them One by one). I just pushed again the layout aswell.

Here is what I have in production: enter image description here

What Am I missing? I notice a difference between the 'layout' of the pop-up but the object layout is the same :/

Also in my sandboxe the url i got after clicking is a modified url: https://XXXXSandboxe/lightning/o/Correction__c/new?count=2&backgroundContext=%2Fone%2Fone.app%23eyJjb21wb25lbnREZWYiOiJvbmU6YWxvaGFQYWdlIiwiYXR0cmlidXRlcyI6eyJhZGRyZXNzIjoiL3NlcnZsZXQvc2VydmxldC5JbnRlZ3JhdGlvbj9saWQ9MDBiN2EwMDAwMDNiTlZ0JmVpZD1hMTA3YTAwMDAwQkU0NktBQVQmaWM9MSZ3cmFwTWFzc0FjdGlvbj0xJmxpbmtUb2tlbj1WbXBGUFN4TmFrRjVUa013ZDA1cE1IZE5WbEY0VGtSdmVFMTZiM2ROUXpRMVRucE9ZU3h1VEhCU2QxWnRUR2xFV0UwMlVuY3hlRmRwWTB0bVoyZHZMVzU1WVd4TFJqY3hjMnA2YmtSdmFqQTBQU3haVjFwclRVZEthQSUzRCUzRCZ1c2UzMDdyZWRpcmVjdD10cnVlIiwicG9zdFBhcmFtZXRlcnMiOnsiaWRzIjpbXX19LCJzdGF0ZSI6e319.

In my production the URL doesn't seems to be interpretated correclty as the URL is not modified:

https://XXXXPROD/lightning/o/Correction__c/new?defaultFieldValues=Audit_Finding__c%3Da103V000000TEnO%2COrigination__c%3DManufacturing%20Site%2COrigination_Entity__c%3Dzzzzz%2CTitle__c%3DTraining%20-%20Local%20zzzz%20-%20Test&count=1

If any of you has an idea I feel very dumb to be stuck on that. Thanks.

6
  • Are you certain that you're pressing the right button in Prod? What did you name the button? Something obvious, or just "New"? Also, not sure if it would help or why it would make a difference between Sandbox & Prod, but try removing the whitespace in the URL. You have a spacebar between defaultFieldValues= and the rest of the string, for example. (defaultFieldValues= Audit_Finding__c) Commented May 29, 2024 at 14:46
  • @MorganMarchese Thanks for the answer. I'm certain the button is the same it has a specific name: 'new correction from finding' and when i'm modifying the button the URL change accordingly. I did try to remove the space but it's still not working. I also updated my question. Commented May 29, 2024 at 15:09
  • Am I correct that in Sandbox the New Record screen is opening in full screen but in Production the New Record screen is opening as a modal? Commented May 29, 2024 at 15:19
  • the backgroundContext is just the lightning way of doing the Classic retURL and was probably added by Lightning based on the way you were testing. In sandbox is this a copy-paste typo ...?&defaultFieldValues=...? You have ?& which is not correct. You are also URLENCODEing things that don't need it - like IDs, and those that do, like text fields Commented May 30, 2024 at 5:09
  • @MorganMarchese they are both opening in modals (sorry for the delayed answer) Commented May 30, 2024 at 8:08

1 Answer 1

0

Here to answer my own question:

I still don't know why it is happening but i found a workaround. I added "&nooverride=true" at the start of my button and now it is working in production.

Like this => "/lightning/o/Correction__c/new?&nooverride=true&defaultFieldValues=" Etc...

Have a good day

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.