I need to pre populate few fields like Ordered Date when user clicks on "Save & New" button while trying to create a record in lightning.

Lets say when user clicks New button on the custom object list page, user is shown with fields; user fill those fields with valid values and clicks "Save & New" button which will save and open another pop up where few fields need to be pre populated with the values which were entered in the first creation of record.

Thanks in advance.


Salesforce has added a new feature in lightning that you can show prepopulated field from custom buttons you can follow this syntax to populate values

    CustomCheckbox__c={!IF(Account.SomeCheckbox__c, true, false)}

Whilst you want to pre-populate values then you can create a custom lightning component using lightning: RecordEditForm and set predefined values in record edit form and on you can add your custom button there save and new and true same component to reinitialised values refer this link for Lightning:RecordEditForm

  • Thank you Dheeraj. Let me try this and let you know whether I am able to achieve it or not.
    – getty
    May 6 '20 at 9:53
  • its very simple you will get sample code in google as well. if you stuck anywhere feel free to ask. May 6 '20 at 11:27

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.