0

I have a custom object named New/Renewal Tracker in that object there are many quick actions button what i want to do is clicking on that quick action button, want to change a picklist value e.g if i clicked on draft button picklist value will be draft, if i click on complete button picklist value will be changed to complete

enter image description here

my problem is when click on complete review button i have called standard record edit page

enter image description here

when page loads it shows picklist values of record what i want when the page loads it shows value completed as i click on completed button

  • I have create a component where that I used lightning record form but when i click on completed review button it redirects to that component it dosent show on same quick action modal – Pranav Mandlik Sep 13 at 9:23
  • When you click on custom action, it should update the picklist and show a message in quick action modal that record is updated to 'draft' or other value? – salesforce-sas Sep 13 at 9:24
  • problem is if u see 2nd screenshot, i clicked on complete review button in picklist status i want to update that to complete (not data base update just want to change field value when that forms load) – Pranav Mandlik Sep 13 at 9:41
1

The force:editRecord does not allow you to pre-define any value other recordid of the record to be update. As a workaround:-

You can use quick action of type update a record by pre-define a value for the field you are looking for. It will give you the picklist value selected by default when you click on the button. Based on the user interaction with save button, the value will be get saved.

A sample example with step is:-

  1. In the object management settings for accounts, go to Buttons, Links, and Actions.
  2. Click Create a Case.
  3. In the Predefined Values related list, click New.
  4. From the Field Name drop-down list, select Status.
  5. Set its value to New.
  6. Click Save.
  7. Now we need to remove the Status field from the action layout. On the action detail page, click Edit Layout.
  8. Click the Status field on the layout and drag it up to the palette.
  9. Click Save.

Tip You can remove a required field from the action layout, but make sure that the field has a predefined value. Otherwise, users can’t create records.

Read more here:-

  1. Try It Out: Set a Predefined Field Value on an Action
  2. REPLACING URL HACKS WITH PRE-DEFINED ACTIONS IN LIGHTNING EXPERIENCE

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.