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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to create Entitlement Product Programmatically?

(0) ShareShare
ReportReport
Posted on by

Hey, i'am trying to add entitlement products to entitlement using a plugin.

but it seems i cannot accomplish this with the usual service.Create(entitlementproduct), i receive this error:

The 'Create' method does not support entities of type 'entitlementproducts'.

What is the correct course of action to accomplish what i want? I noticed there is something like service.Associate, but i don't seem to find the coorect way to use this, i'm not even shore if that can solve the problem in any way.

Any help or direction will be appreciated,

Thanks in advance

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    below is the sample of using associate. Never try never know.

    docs.microsoft.com/.../gg326161(v%3Dcrm.8)

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Please try the below code:

    ===============

     AssociateRequest request = new AssociateRequest();

                   EntityReference mon1 = new EntityReference("entitlement", new Guid("EBE0D103-8FD5-E811-A968-000D3AE058F0"));

                   EntityReference mon2 = new EntityReference("product", new Guid("832D12C4-7F95-E811-A961-000D3AE05E81"));

                   request.Target = mon1;

                   request.RelatedEntities = new EntityReferenceCollection { mon2 };

                   request.Relationship = new Relationship("product_entitlement_association");

                   service.Execute(request);

    =================

    Hope this helps.

  • Community Member Profile Picture
    on at

    Hi Fun,

    Thank's for the link.

  • Community Member Profile Picture
    on at

    Ravi, you're the men!!

    It worked like a charm.

    Many many thanks.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans