Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to find order product on the behalf of order guid?

Posted on by Microsoft Employee

Hi Experts,

How to check ordered product on the behalf of orderId ?

Please give me suggestion.

Thanks in advance!

*This post is locked for comments

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: How to find order product on the behalf of order guid?

    Hi,

    You can write a retrieve multiple request to fetch orderline item based on the order id. Can use simple fetch like below as well

     string orderlinefetch = string.Format(@"<?xml version="1.0"?>

    <fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">

    <entity name="salesorderdetail">

    <attribute name="productid"/>

    <attribute name="productdescription"/>

    <attribute name="priceperunit"/>

    <attribute name="quantity"/>

    <attribute name="extendedamount"/>

    <attribute name="salesorderdetailid"/>

    <order descending="false" attribute="productid"/>

    <filter type="and">

    <condition attribute="salesorderid" operator="eq" value="orderid"/>

    </filter>

    </entity>

    </fetch>");

    EntityCollection orderlineEntities = orgService.RetrieveMultiple(new FetchExpression(orderlinefetch));

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: How to find order product on the behalf of order guid?

    Hi,

    If you want to do it using client side, use webapi to retrieve the order product. Refer below article for more information.

    [View:https://msdn.microsoft.com/en-us/library/gg334767.aspx:750:50]

    if you want to do it using workflow or plugin.

    FetchXML

    [View:https://msdn.microsoft.com/en-us/library/gg328332.aspx:750:50]

    Query Expression

    [View:https://msdn.microsoft.com/en-us/library/gg328300.aspx:750:50]

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,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