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

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


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” }; }


function success(response) {

if (response.ok) {




).catch(function (error) {



Please mark my answer verified if this is helpful!


Bipin Kumar

Follow my Blog:

Source link

Leave a reply

Please enter your comment!
Please enter your name here