Record Dashlet - How to update the dashlet after I automatically create a record from a custom button ?

Hello everybody,

I was wondering if one of you can help me.

We customized the record dashlet view for the meeting record to add an action button ; on click, this will open a drawer to create an opportunity record.
We were able to link the opportunity to the call (update the flex relate relation) but we don't know how to automatically refresh the call record dashlet (to reflect that change) when the opportunity creation is completed and the drawer closed.

Currently, with a basic JS open drawer, after the creation it is weird : we are not retrieving the dashboard BUT as if we were trying to update the focus dashboard.

I don't know if I am clear enough but any help is welcome, even more if you did something similar and it works for you :-)

Fred

Parents
  • Hello  
    If I understand correctly, you are on the record view of a Contact or Account and you have a meeting or call on the subpanel. You open the Record Dashlet of that meeting/call in the intelligence pane and as you hold the call and you want to create an Opportunity that resulted from that Meeting/Call. So you added a button to open the Opportunity drawer and create said Opportunity with data from the Meeting/Call and relate the Opportunity to that Meeting/Call.

    When you complete the save of your Opportunity you want to refresh the Dashlet that you started from, Meeting/Call, so it shows the proper flex relate.

    You probably know this already, but, just in case it helps...


    I have not tired this with Dashlets but when working with Subpanels with save actions that update the record view you can refresh the parent record (the record view) after a save by simply fetching the parent again in the subpanel-list view. I have one case where I have multiple operations in subpanels that change the Record.


      refreshParent: function(){
        var parentmodel = this.context.parent.get('model');
        parentmodel.fetch();
      },

    Similarly I've updated subpanel A when subpanel B is changed

      refreshDetails: function() {
        //refreshes ProductDetails subpanel after a Product is deleted.
        var parentContract = this.context.parent.get('model'),
            detailsLink='wcont_wolframcontractpdetails_wcont_wolframcontracts',
            contractDetailsCollection = parentContract.getRelatedCollection(detailsLink);
        contractDetailsCollection.fetch({relate:true});
      },
    

    I wonder if you could apply something similar so that after the drawer closes you can trigger a fetch on the parent, assuming the parent is indeed the dashlet.

    Francesca

Reply
  • Hello  
    If I understand correctly, you are on the record view of a Contact or Account and you have a meeting or call on the subpanel. You open the Record Dashlet of that meeting/call in the intelligence pane and as you hold the call and you want to create an Opportunity that resulted from that Meeting/Call. So you added a button to open the Opportunity drawer and create said Opportunity with data from the Meeting/Call and relate the Opportunity to that Meeting/Call.

    When you complete the save of your Opportunity you want to refresh the Dashlet that you started from, Meeting/Call, so it shows the proper flex relate.

    You probably know this already, but, just in case it helps...


    I have not tired this with Dashlets but when working with Subpanels with save actions that update the record view you can refresh the parent record (the record view) after a save by simply fetching the parent again in the subpanel-list view. I have one case where I have multiple operations in subpanels that change the Record.


      refreshParent: function(){
        var parentmodel = this.context.parent.get('model');
        parentmodel.fetch();
      },

    Similarly I've updated subpanel A when subpanel B is changed

      refreshDetails: function() {
        //refreshes ProductDetails subpanel after a Product is deleted.
        var parentContract = this.context.parent.get('model'),
            detailsLink='wcont_wolframcontractpdetails_wcont_wolframcontracts',
            contractDetailsCollection = parentContract.getRelatedCollection(detailsLink);
        contractDetailsCollection.fetch({relate:true});
      },
    

    I wonder if you could apply something similar so that after the drawer closes you can trigger a fetch on the parent, assuming the parent is indeed the dashlet.

    Francesca

Children
  • Hello  

    Thank you for taking the time to reply, I really appreciate it.

    I was able to identify the root cause. When creating a button dynamically in the dashletrecord view, the system automatically attached an event to it, which triggered the edit mode for the entire view. I didn’t notice this at first because the event I was explicitly attaching was opening a drawer—so both events were being fired at the same time. The fix was simply to prevent the propagation of the event so it wouldn’t trigger the edit mode.

    Thanks again for your help and for taking the time to look into this!