We can associate the Sales Literature to the Product using
the below code.
var xrm = new XrmServiceContext("Xrm");
Guid salesLiteratureId= new Guid();
EntityReferenceCollection relatedEntitiesSalesLiterature = new EntityReferenceCollection();
relatedEntitiesSalesLiterature.Add(new EntityReference(CompetitorProduct.EntityLogicalName,
salesLiteratureId));
Relationship relationshipSalesLiterature = new Relationship("productsalesliterature_association");
xrm.Associate("product", newProduct.Id,
relationshipSalesLiterature,
relatedEntitiesSalesLiterature);
Here the productsalesliterature_association is the
relationship between the Price List and the Product. We can see the
relationship in the CRM portal. The steps are
Settings->Customizations->Customize the
System->Entities->Select the Entity ->Click on Relationship.
No comments:
Post a Comment