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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Assign Request Not Assigning

(0) ShareShare
ReportReport
Posted on by

Good day,

Kindly assist,I am writing a plugin that triggers on update of an entity.

This then check a specific attribute on an entity if this attribute is true

It then assigns to the relevant person.

My problem is that it is not assigning at all,but my assign method I have debugged through it it contains all the values and the values are not nulls ,what could be the cause of not to assign ? see code below and assist 

try
{
// Create the Request Object and Set the Request Object's Properties

AssignRequest assign = new AssignRequest
{
//User to whome you are assigning the entity to
Assignee = new EntityReference("systemuser", OwningUserID),
////Current record which you are assigning to the user
Target = new EntityReference(TargetEntity.LogicalName, TargetRecordID)

};


// Execute the Request
orgService.Execute(assign);
}
catch (Exception ex)
{
throw new InvalidPluginExecutionException("An error occured while assinging Tier3 User to a DHA Case." +
ex.Message);
}

the following contains information and are not nulls TargetEntity.LogicalName, TargetRecordID,OwningUserID but no assignment is happening.

Help ins this regard will be much appreciated.

Thanks 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rahul-Waghmare Profile Picture
    990 on at

    Hi,

    Did you get any error?

    Please check Security role for the user you are trying to assign the record. To perform this action, the caller must have privileges on the specified entity in the Target property and access rights on the specified record in the Target property.

    msdn.microsoft.com/.../microsoft.crm.sdk.messages.assignrequest.aspx

    Regards,

    Rahul

  • Verified answer
    Kumar Viju Profile Picture
    1,026 on at

    Apart from Rahul Suggestion , Also check if you are performing this below logic.

    "This then check a specific attribute on an entity if this attribute is true" - Are you checking any condition before doing the assign logic.

    Ex:

    If ( CRM. Attribute== true ) --> Make Sure that it goes inside the loop. Since Plugin Execution Context will not check this statement as no update was performed on this attribute.

    {

       Assign Record To User

    }

    Because even if the TargetEntity.LogicalName, TargetRecordID,OwningUserID contains values , it will not go into the loop.

  • Conor Gallagher Profile Picture
    715 on at

    The only issue I can think of is: Are you trying to assign to a user within a different business unit? If so you might need to do this via a workflow (with a custom workflow activity if the code is too complex). I'm not sure why you need to do it this way, but I remember running into a similar problem in the past.

  • Verified answer
    Ryan W Anderson Profile Picture
    on at

    The AssignRequest Class is deprecated and the proper way to assign a record is now to use an UpdateRequest that sets the ownerid attribute. See Perform specialized operations using Update for more details.

    However, since you are trying to assign the current record, you should be able to accomplish this by registering your plugin in pre-operation and setting the ownerid attribute on the InputParameters["Target] entity.

  • Rahul-Waghmare Profile Picture
    990 on at

    Please mark the suggested answer so that it will help other community member with correct answer.

    Thanks,

    Rahul

  • MAJBlackburn Profile Picture
    80 on at

    We are having an issue where users with the "Assign" privilege global, but Write only their own were unable to assign records they did not own. In CRM 2011, this worked fine, but after migrating, they got the message: "SecLib::AccessCheckEx failed." Effectively the user was trying to Update a record which they did not own, so did not have rights to Write.

    So I figured, OK, the Assign Request is deprecated, so the assign button has been updated to do an update instead of an Assign Request. So the immediate solution was to grant the rights needed (since it was never about enforcing security but about enforcing process; they could effectively edit any record by assigning it to themselves first). But then I went back & looked at the network traffic, and the OOTB Assign Dialog *IS* performing an AssignRequest, so their existing permissions SHOULD have been sufficient.

    Can you explain what's going on here? I mean, besides you didn't really test the admittedly bizarre permissions grant of "Assign but do not write." I may end up having to write a plugin to enforce the only updates allowed are to the Owner unless the current user is the Owner, which will be annoying.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans