2

JavaScript controller

createCC:function(component,event,helper){
    let ccbhold = component.find("Ccommentbody").get("v.value");
    let phold = component.get("v.Cispublished");
    let idhold = component.get("v.recordId");

    var action = component.get("c.createccapex");
    action.setParams({parentid : idhold, ccbody : ccbhold, bpublic : phold});

    action.setCallback(this,function(response){

        var state = response.getState();

        if(state === "SUCCESS"){
            component.set("v.showcreatemodal", false);
            $A.get('e.force:refreshView').fire();

        }
    })
    $A.enqueueAction(action);
}

Apex Controller:

@AuraEnabled
public static void createccapex(ID parentid, String ccbody, Boolean bpublic){
    Casecomment cc = new Casecomment();
    cc.parentid = parentid;
    cc.CommentBody = ccbody;
    system.debug(bpublic);
    cc.ispublished = bpublic;
    insert cc;
}

The record inserts properly, the modal window closes, the refresh happens, but only on the header and the right bar.

the only thing that doesn't refresh is the parent component(which is a tab on the detail page of the record.

2
  • the parent component should listen to the refresh event. Which component is it? Mar 25, 2018 at 10:34
  • its the component itself that doesn't refresh. I fixed it in my code by running init again as well as forcing a refresh.
    – Tim Willis
    Mar 26, 2018 at 18:12

0

You must log in to answer this question.

Browse other questions tagged .