CrmRestKit - Associate

May 7, 2012 at 3:12 PM

Hello,

I try to add List Marketing Members with CrmRestKit.Associate but I have errors:

Sample 1 : CrmRestKit.Associate(CrmRestKit.EntityReferenceFactory(Xrm.Page.data.entity.getId()), 'List', CrmRestKit.EntityReferenceFactory(sCurrentId), 'Contact', 'listcontact_association', false)
         .fail(function (xhr, status, ethrow) { alert('Error: ' + status + ': ' + xhr.statusText + '.'); } );

Result : Bad Request

Sample 2 : CrmRestKit.Associate(sCurrentId, 'Contact', Xrm.Page.data.entity.getId(), 'List', 'listcontact_association', false)
         .fail(function (xhr, status, ethrow) { alert('Error: ' + status + ': ' + xhr.statusText + '.'); } );

Result : Internat Server Error

If someone have an idea ?

Thank you in advance.

Ernest.

May 16, 2012 at 8:35 AM

Now it’s ok with AddMemberListRequest.

Hereafter the link for a sample:

http://community.dynamics.com/product/crm/crmtechnical/b/mileyja/archive/2011/11/14/add-an-entity-member-to-a-marketing-list-in-microsoft-dynamics-crm-2011-using-net-or-jscript.aspx

 

Thank Daniel Rene Thul for the link.

Ernest.