How to re-render the "record view" of a quote after a background processing triggered by a button ?

Hi,

I am facing a problem that is maybe easy for some of you

  • on the quote module, I created a custom button
  • when triggered, a custom API is called
  • a part of this API process is to reorganize the Quote Line Items

My problem is the following : how to force the re-render of the quote record view (quote record and also the QLI section) after my API call is successful ?

Best regards,

Fred

Parents
  • You basically want to refresh the related QLIs

    I am not sure if Quotes is different but I have a custom module and when something changes in one subpanel I want to refresh the collection in another subpanel.

    To do this I use the controller and trigger a refresh when needed (there is a process not seen here that deletes some Product Detail records when the Product is deleted).

    The refresh function looks like this:


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

    In short: I get the parent, get the related collection I want to refresh and trigger another fetch on that collection. The system takes care of the re-render when the fetch is triggered.

    Hope this works for your scenario.

    FrancescaS

  • Hi  ,

    we gonna try this and give you a feedback. But it seems good.

    Fred

  • I was thinking about this some more, and to refresh the whole quote you should be able to just do a simple this.model.fetch() if you are in the quote controller or get the parent quote model and then fetch it.

    var parent = this.context.get("parentModel");
    parent.fetch();

Reply Children
No Data