Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How do I add items in the sub menu options through c#?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have an existing opportunity with some menu items as shown in the below image.

OppProductLine.jpg

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

  • Suggested answer
    Andreas Cieslik Profile Picture
    Andreas Cieslik 9,265 on at
    RE: How do I add items in the sub menu options through c#?

    Here is a sample with early bound:

    msdn.microsoft.com/.../gg509009.aspx

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans