I have an existing opportunity with some menu items as shown in the below image.
I want to programatically add the product using a windows forms application.The existing product was added using Dynamics Online Portal. But, I need to do the same via c#.
After searching in the internet, I found out that we can achieve this by using Related Entities & calling Service.Execute(Request).
So first, I found out the entity names of the required.As I found the entity name for Motor Products, I used Service.Create(entity) to add the product. The product was added but it wasn't showing under this opportunity as I didn't pass the reference for this opportunity.
Then, I tried to find the relation between Opportunity and Product Line Items but I couldn't find any common unique attribute (ex: opportunityid is not there in Product Line Items). Ultimately, the application was throwing errors.
Is there any way we can add the product in the Motor Products programatically?
*This post is locked for comments