Associating a User to Security Role via API isnt displayed in the UI?

0
77
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


Hi,

Could you please share the code you used to associate security role to a user?

I hope this is what you are using –

// NOTE: Associate Request in Xrm.WebApi supports multiple children, you can add them inside the relatedEntities array

var associateRequest = {

target: { entityType: “systemuser”, id: “7400710c-d394-eb11-b1ac-0022486ec861” },

relatedEntities: [

{ entityType: “role”, id: “e0d2794e-82f3-e811-a951-000d3a1bcf17” }

],

relationship: “systemuserroles_association”,

getMetadata: function () { return { boundParameter: null, parameterTypes: {}, operationType: 2, operationName: “Associate” }; }

};

Xrm.WebApi.online.execute(associateRequest).then(

function success(response) {

if (response.ok) {

console.log(“Success”);

}

}

).catch(function (error) {

console.log(error.message);

});

Please mark my answer verified if this is helpful!

Regards,

Bipin Kumar

Follow my Blog: xrmdynamicscrm.wordpress.com/



Source link

Leave a reply

Please enter your comment!
Please enter your name here