web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Reading Product Properties from Product Line Item Grid

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

How do I read the product properties value from the product line item (opportunityproductgrid). I want this information to be passed-on to another system (non-Microsoft ERP) which I will do using a plugin and web-services (of the target system). I am unable to understand how to retrieve the value as the opportunityproduct table does not have this value (or couldnt find atleast). I will need this information to be read using the plugin (hope this is possible).

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Haytheim Profile Picture
    15 on at
    RE: Reading Product Properties from Product Line Item Grid

    After investigation i found a solution and here is the guided steps :

    1- I create custom fields for each properties in quotedetails entity.

    2- I create a Flow that is triggered when i chose a values for properties by connecting to dynamicpropertyinstance entity to get the value of each ones

    3- In the same Flow i connect to dynamicproperty to map the values with the name of the properties and to get also the related quotedetails id and the product id.

    4- Update the quotedeatils with values of properties.

    5- Download the template of the quote entity and will find the custom fields created above.

    With these steps you can generate a quote that contains properties of product.

  • Laurent SOKOLOFF Profile Picture
    on at
    RE: Reading Product Properties from Product Line Item Grid

    Hi Scott

    This morning I finally found the "Related entities" collection and also the "dynamicpropertyinstance" !

    Many thanks for your advice

    Have a nice day

    Laurent 

  • Laurent SOKOLOFF Profile Picture
    on at
    RE: Reading Product Properties from Product Line Item Grid

    Hi Scott

    Thank you for your answer

    But I'm sorry I don't understand what do you mean with "related entities"

    In my code I use EntityCollection and I don't find DynamicPropertyInstance.

    It will be great if you have a sample to explain what you said.

    My Google searches give nothing good :-(

    Thanks for your help

    Laurent

  • ScottDurow Profile Picture
    21 on at
    RE: Reading Product Properties from Product Line Item Grid

    You can find the instances in the related entity collection of each record.

  • Laurent SOKOLOFF Profile Picture
    on at
    RE: Reading Product Properties from Product Line Item Grid

    Hi Scott Durow

    I try to retrieve dynamics properties instances with RetrieveProductPropertiesRequest but when I read the RetrieveProductPropertiesResponse.EntityCollection I just find "dynamicproperty". There is no "dynamicpropertyinstance".

    What's wrong ?

    Here is my code :

    if (entity.LogicalName == "quotedetail" && (Operation == "Create" || Operation == "Update"))
    {
    string msgplugin ="test ok (v4): " + DateTime.Now.ToString();

    RetrieveProductPropertiesRequest reqAttrProd = new RetrieveProductPropertiesRequest();

    reqAttrProd.ParentObject = entity.ToEntityReference();
    //reqAttrProd.RequestName = "plugin attributs";

    RetrieveProductPropertiesResponse respAttrProd = (RetrieveProductPropertiesResponse)orgService.Execute((OrganizationRequest)reqAttrProd);

    EntityCollection attrcoll = respAttrProd.EntityCollection;

    Thanks for your help

    Laurent

  • Suggested answer
    ScottDurow Profile Picture
    21 on at
    RE: Reading Product Properties from Product Line Item Grid

    (In addition to Chitra's answer)

    The Properties are held in an entity called DynamicPropertyInstance - that is linked to the DynamicProperty entity that provides the definition of the property. Each Product Line has a 1:N relationship for each property so although it looks like you are editing a single entity record - there is a separate record for each value you enter for each property.

    There are separate values for each data type (e.g. valueinteger, valuestring, valuedouble etc.) so you need to read the DynamicProperty entity to determine which of the values to read based on the data type attribute.

    The RetrieveProductPropertiesRequest is useful because it pulls down both the values and the property definitions (including the optionset values) as related entities so I would use that for your integration.

    Bare in mind that you can't always rely on the dynamicpropertyid being the same accross all products because if the inheritance is overridden for a specific product, the dynamicproperty is copied but linked to the 'basedynamicpropertyid'

    Hope this helps.,

    Scott

  • Verified answer
    Royal King Profile Picture
    27,686 on at
    RE: Reading Product Properties from Product Line Item Grid

    You can use  RetrieveProductPropertiesRequest by passing lineitem id to ParentObject to retrieve product property of an opportunityproduct item.

    Check the documentation for the same here

    https://msdn.microsoft.com/en-us/library/dn817890.aspx

    Or you can use standard retrieve & Retrieve Multiple (can use query to retrieve) entity.

    The schema name for this entity is DynamicPropertyInstance

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans