Lightning URL Hacks/ Predefault fields in lightning

Remember those days when you showed off the non-code solutions to the clients and felt really awesome with their reactions... and you did this after the demo.




.. And we proudly called them URL Hacks... even though its not much of a hack, 😉, it was just passing parameters.

But it's all gone with Lightning. Boy, did they hate it when those URL buttons didn't work in lightning? I mean, it was so convenient for the users, defaulting certain fields is what they wanted, they have it on so many related lists.

... And then there were Quick Actions, Salesforce promoted them heavily for replacing custom buttons, javascript buttons etc... But it quite didnt hit the spot, I meant, they were fine. Still they are useful in some places.

Then, just to give the users more productive tools, we ended up overriding the new button or creating a custom component etc... We have this force:createRecord actions in aura components, without having to create a lot of code, we can use the existing framework and predefault some of the fields that the users want!

But No more of that! Now Salesforce is giving us this cool feature, I believe they are exposing the same force:createRecord through UI, This is Admin-friendly.

I mean all you have to do is simply put the API names and default values. Pls check this update:

https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_general_lex_navigate_to_record_dfv.htm

Example:
/lightning/o/Vehicle__c/new?defaultFieldValues= Name='System Will Populate it', OwnerId={!Opportunity.OwnerId}, Description__c={!Opportunity.Description},
Special__c={!IF(Opportunity.eligible__c, true, false)}

Well, We still have users switching back and forth between Classic and lightning, so this gave me an Idea to use one button for both classic and lightning.

Stay tuned!

Comments

Popular posts from this blog

Lightning spinner inside Button

Passing URL parameters to controller in Lightning components/ AURA

Nested AURA:IFs in Lightning Components Salesforce