Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Refresh Quote after adding product

Posted on by

Hi,

I have a strange issue.  I'm trying to update quote with some calculations after adding a product.  I have a plugin that updates some number and a javascript that updates others.  I can combine them and add them in my plugin.

No matter what I do, I can't force a refresh of the quote after adding the product.  Is there a trick out there?  I tried js and workflows and nothing works.

The crazy part about it is that this used to work a couple of days ago, but I think it was just timing. 

*This post is locked for comments

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Refresh Quote after adding product

    Hi Emad,

    I read your requirement and responses again, it looks like your plugin triggers on Pre/Post event of Quote Product not quote right. I dont think the quote main form will refresh as the quote change you are making in the plugin is not actually directly triggered by the quote form.

    I just tested the out of the box refresh feature when a quote is added, it uses a separate service to update the calculations when product added: AppWebServices/InlineEditWebService.asmx

    The following snippet is not a fully supported way of doing it but it might work.

    //Bind to add product refresh event

    document.getElementById("quotedetailsGrid").control.add_onRefresh(

    function ()

    {

      // This should refresh calculations on quote form

       Mscrm.GridControlLite.recalculateRecord();

    });

  • Suggested answer
    pavanmanideep Profile Picture
    pavanmanideep 1,329 on at
    RE: Refresh Quote after adding product

    Hi Emad,

    Alternately you can try to refresh the form after adding the product using Javascript functions for the data to show correctly. May be you added few more customizations on the form update recently which might be the issue.

    https://www.powerobjects.com/blog/2017/03/21/triggering-a-form-refresh-after-crm-dialog-is-closed/

  • Emad Hanna Profile Picture
    Emad Hanna on at
    RE: Refresh Quote after adding product

    I have pre and a post and they both run because I see the data if I hit refresh.  So the plugins run, I'm trying to figure out how to refresh the quote so I can see the data.

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Refresh Quote after adding product

    Could you share the details on when your plugin is triggered? i would throw an exception from plugin to see if its actually triggered

  • Emad Hanna Profile Picture
    Emad Hanna on at
    RE: Refresh Quote after adding product

    Hi the plugin is Sync and the workflow is realtime.

  • Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Refresh Quote after adding product

    You plugin is Sync or Async? When you said you tried workflow, did you try real-time or background workflow?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans