RetrieveProductPropertiesRequest message in CRM 2015

Hi,

In CRM 2015, we have new feature of having properties to the Products. Sometimes, we get a requirement to retrieve them using SDK.

We can retrieve them in two ways
1) Using the new message – RetrieveProductPropertiesRequest
2) Using our ever green Fetch XML

RetrieveProductPropertiesRequest expects a parent object(entityreference) for retrieving the properites of the product. Parent Object can be Quote Product, Opportunity Product, Invoice Product or Order Product.

RetrieveProductPropertiesRequest objRetrieveProductPropertyReq = new RetrieveProductPropertiesRequest();

objRetrieveProductPropertyReq.ParentObject = new EntityReference(“quotedetail”, new Guid(“”));
RetrieveProductPropertiesResponse objRetrieveProductPropertiesResponse = (RetrieveProductPropertiesResponse)iService.Execute(objRetrieveProductPropertyReq);
EntityCollection entProductProperties = objRetrieveProductPropertiesResponse.EntityCollection;


If you are using Fetch XML, just the guid of Quote Product, Opportunity Product, Invoice Product or Order Product against regardingobject.

string strFetchXML = @”
  
  
  
  
  
   “;
EntityCollection entColDynamicProperties = iService.RetrieveMultiple(new FetchExpression(strFetchXML));

Hope this helps.


Happy CRM’ing
Gopinath

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s