I have worked on LWC requirement where

  1. On Case record, I have customized a component, which is based on custom metadata for the UI display and multi picklist for the back end.
  2. As a case owner ONLY I CAN EDIT or selected a picklist, it will display the options based on picklist from the custom metadata(the same value will be in the multi picklist in the backend). 3)The issues I am having are how can I after saving the record a) refresh the page to display the checked boxes and b) disable the picklist chosen but not the options.

`import { LightningElement, track,api } from 'lwc'; import checkOwnerId from '@salesforce/apex/checkCaseFieldsCaseOwner.checkCurrentUserIsRecordOwner'; import getCustumMetadata from '@salesforce/apex/checkCaseFieldsCaseOwner.getCustumMetadata'; import updateCasewithChosenvalues from'@salesforce/apex/checkCaseFieldsCaseOwner.updateCasewithChosenvalues';

export default class TodoMultipicklistCustom extends LightningElement {

@track options=[];
@api recordId;

@track checkboxesString;

    checkOwnerId({recordId: this.recordId})
        .then(result => {
                this.disabled = false;


        .catch(error => {
            this.error = error;


get brokerOptions() {
    return [
             { label: 'None', value: 'None'},
             { label: 'State Farm Principal Officer', value: 'State Farm Principal Officer' },
             { label: 'State Farm Licensed Team Member', value: 'State Farm Licensed Team Member' }

handleChange(event) {
    this.value = event.detail.value;

    Type :  this.value })

    .then(result => {
       let  optionsObject;

        //result.forEach(element => console.log(element));
            optionsObject = new Object();
              optionsObject.label = element;
            optionsObject.value = element;
                 console.log('+++++options*'+ JSON.stringify(optionsObject))
           console.log('***'+ JSON.stringify(this.options))

}) .catch(error => {

             this.error = error;

} handleCheckboxgroup(event) { let data; data = event.target.value;

console.log('*****'+ this.checkboxesString);




            recordId: this.recordId,
            ToDo_Typ: this.value,
            optionsChecked: this.checkboxesString


     console.log('unable to save the record due to'+JSON.stringify(this.errorMessage));




3 Answers 3


Use the Lightning Data Service's updateRecord method to update your Case record instead of using an imperative apex method. The record data refreshes automatically as LDS refreshes the view if the cache is stale.

PS: You could also get the current record details using LDS' getRecord method instead of an Apex call in the case of checking OwnerId.


So i used .then(result => { this.Case = result;

    window.location.assign('/'+ this.recordId);

to refresh the page, but I am not able to display the previously saved the multiselect values? Any suggestions why


One can use this getRecordNotifyChange(recordId) to refresh the standard salesforce component to refresh (without actually refresh the browser) after saving a field from a custom component provided the custom component in the record page.

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.