Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Fill a subgrid in quote entity after revised with the same data

Posted on by 450

Hi there All.
I Have a Subgrid in Quote, in which there are records of my custom entity, And also the custom entity display in left side of the form,Because the custom entity has N:1 relation with quote.
Every Quote can have many of my custom entities  record.
It is ok,But when I revise the Quote, I want that the same data of previous subgrid display in the new quote subgrid, as well as other fields that copy and appear from the previous subgrid.
Is there any solution or something like that?

*This post is locked for comments

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Fill a subgrid in quote entity after revised with the same data

    Sorry Albert but order is a different entity. Yes you can retrieve the results using fetchxml but here we need to create records for the newly created qoute record.

  • Albert_ Profile Picture
    Albert_ 450 on at
    RE: Fill a subgrid in quote entity after revised with the same data

    But It does not seem logical.

    I agree with your first part.

    revise a quote, it create a new record with the same Quote ID.

    And also the second part :

    The data you see on your old quote for the subgrid is the actual records which are related to your old quote.
    So there should be a way using fetchXML or something like this.
    Previously I could display this subgrid in the order.
    And you know Order is also a quote.
    I did that with JS and using fetchXML.
    I tried the previous way I did in the order, But no success.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Fill a subgrid in quote entity after revised with the same data

    When you revise a quote, it create a new record with the same Quote ID. The data you see on your old quote for the subgrid is the actual records which are related to your old quote. IN order to see the same subgrid records on the revised quote you need to create new records which cannot be done via view or js as you would need to create these records when the revised quote is created. The best way to do it is create a plugin.

    Hope this helps.

  • Albert_ Profile Picture
    Albert_ 450 on at
    RE: Fill a subgrid in quote entity after revised with the same data

    Can I do this in view? Via JS?

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Fill a subgrid in quote entity after revised with the same data

    Hi Albert,

    You need to write a plugin on create of Quote entity which first check if the quote is a revision. If it is, then get the records from your custom entity and then either update the quote field of your custom entity or create new record with the new quote.

    Take a look here for plugin code-

    www.crmanswers.net/.../catch-revise-quote-message-inside-plugin.html

    Hope thi shelp.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans