Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Group and order by

Posted on by 105

How do i group order lines by name and get the last created record from each group and clone that line? 

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Group and order by

    Hello,

    If you want to achieve your requirement using Plugin c# code then please see my blog for Group by usage in Fetchxml

    xrmdynamicscrm.wordpress.com/.../

  • sjov Profile Picture
    sjov 105 on at
    RE: Group and order by

    Yes, its not about the quantity. For example we have a contract for internet that its duration is 12 months. For each month we need to create a new line of the product. That is why we need to find the last created line of each product and based on that to clone that last line for each product. (if the contract is still active of course) IMG_2D00_a00d52f2d5d5e4d85f6c3c2e9c185594_2D00_V.jpg

  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,525 Super User 2024 Season 1 on at
    RE: Group and order by

    Can you share some screenshots if possible. because as per above explanation is it possible that a user can add same product multiple times(Not talking about the quantity but number of product rows)?

  • sjov Profile Picture
    sjov 105 on at
    RE: Group and order by

    Yes.

    I have an order. In that order i have products. Each product has a contract from and to date. For each product I have as many lines as long as the contract is active (for each month) .

    Now, i have to group these products by name and find each product's last created line and clone that line.

  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,525 Super User 2024 Season 1 on at
    RE: Group and order by

    Hello,

    Can you elaborate your requirement more.

    Thank you,

    Amit Katariya

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