I am having the Lightning component that uses the Lightning Data Services to update the fields on the Case record, it works fine if the component is updating fields like status or origin like that. But when I try to update the record type/owner the page is not refreshed after the update happens.

Below is the component where I am updating the record type and Owner basically it is like transfering the case from one Dept to another

<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId" access="global"  >
<aura:attribute name="loaded" type="Boolean" default="false" />
<lightning:spinner variant="brand" alternativeText="Loading..." class="{!(v.loaded? 'slds-show': 'slds-hide')}" />
 <lightning:recordEditForm aura:id="form" 
        <lightning:inputField aura:id="statusInput" fieldName="Status" class="slds-hide" />
        <lightning:button variant="brand" type="submit" label="SF Support" />


    handleSubmit: function(component, event, helper) {
        var fields = event.getParam('fields');
        fields.OwnerId = 'xxxxxxxxxx'; // Owner is SF Support           
        fields.RecordTypeId = 'YYYYYYYYYYYYY';
        fields.Status = 'New';
    handleError: function(component, event, helper) {
        const fieldErrors = event.getParam('output').fieldErrors;
        const separator = ' ';
        let errMessage = Object.values(fieldErrors).map(field => {
            return field.map(error => error.message).join(separator);
            type: 'error',
            mode: 'pester',
            message: errMessage  }).fire();       
    handleSuccess: function(component, event, helper) {
            type: 'success',
            message: 'Case passed to Salesforce Support!',
            mode: 'pester'

Though the Owner/RecordType is updated the page is not refreshed. Below screesnshot shows the page is not refreshed , I should be seeing the Owner as SF Support but it still shows the old owner Services but Toast is fired saying the case is passed.

enter image description here

But when do the full page refresh it shows up SF Support. Can anyone please help me what I am missing here

  • The code does refresh the owner value for me. The detail component is the standard component or you have custom detail component? Oct 7 '20 at 5:16
  • It is the standard component, when the button is clicked it freezes the screen for sometime and doesnt let me refresh the browser
    – user81642
    Oct 7 '20 at 12:12
  • @sanketkumar Did you change the record type as well when you tried ?
    – user81642
    Oct 7 '20 at 12:59
  • yes, i have tried both and worked perfectly fine. Oct 7 '20 at 14:21
  • Do you think any reason for this behavior I am seeing. Is it safe to use the .reload() with the controller on the handlesuccess?
    – user81642
    Oct 7 '20 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.