We have an intermediary VF page that lets users select certain values to auto fill the new record form for an object. When a user clicks Continue on our page, they are taken to the standard Salesforce new object.
We construct the URL with parameters in the Apex controller for our VF page and send the user on to it. This is fine in classic just passing along current parameters into the URL. The problem is Lightning...
I've found with Opportunities, the account Id parameter Salesforce passes is accId
, then for Case the account Id parameter Salesforce passes is def_account_id
. Then these parameter names don't match up to field entity definition names... and I know you pass default values in the defaultFieldValues
parameter for Lightning to do URL hacking, but passing these things into that parameter does nothing as it probably wants actual field names.
But so far I can't find any way to match the random parameter names that Salesforce apparently changes for each object to any actual field name on the object. So constructing a URL and being able to handle any object just doesn't seem entirely possible...
Am I making this harder than it needs to be? Is there some trick I'm missing to passing along URL parameters in lightning and classic for any object?? Wondering if anyone has been able to figure this out or found info to do this as I have not been able to find anything.