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)

Opportunity Plug-In Create and Update - Plug-in Registration Profile Debugging

(0) ShareShare
ReportReport
Posted on by 397

Hi,

I am running into a strange issue recently. I have created a Opportunity Plug-in and registered on Create and Update steps. In Update step i have some business logic that will retrieve the SalesProcessStage (ActiveStageName) name, i am retrieving this using the leadtoopportunitysalesprocess.

When i Qualify a Lead there is some thing going wrong and when i debug the code its going to update plug-in call and its failing exactly at my fetchxml call that will retrieve some opportunity fields along with ActiveStage. Here is the query.

string oopfetchXml = "<fetch mapping='logical'>" +

"<entity name='opportunitysalesprocess'>" +
"<attribute name='activestageid'/>" +
"<filter type='and'>" +
"<condition attribute='opportunityid' operator='eq' value='" + opportunityId + "' />" +
"</filter>" +
"<link-entity name='opportunity' alias='oppsalesprocess' link-type='outer' to='opportunityid' from='opportunityid'>" +
"<attribute name = 'name'/>" +
"<attribute name = 'opportunityid'/>" +
"</link-entity>" +
"</entity>" +
"</fetch>";

When i tried to debug, the call was failing with below error during the above fetcXml Retrieval but when i ran the same fetchxml in XRMToolbox it works fine.

{"contextUserId=9d5b504c-4b3c-e611-80e7-5065f38ada11 has correct privileges but allowImpersonationOfOrganizationSystemUser == false. Parameter'user'=860ace9d-2597-436b-8f79-edddcd663f8c, callerId=860ace9d-2597-436b-8f79-edddcd663f8c."},


This plug-in is generic and contains the code for Create and Update MessageTypes. When i was debugging the Lead to Qualify i can see the call is going to two steps (Create/Update) in my my plug-in trace log and the above error is coming in Update step. My question is when i qualify a Lead does it go to Create and Update both the opportunity steps? I am wondering why the call is going to Update code block. I am unable to figure out what exactly the below error is?

{"contextUserId=9d5b504c-4b3c-e611-80e7-5065f38ada11 has correct privileges but allowImpersonationOfOrganizationSystemUser == false. Parameter'user'=860ace9d-2597-436b-8f79-edddcd663f8c, callerId=860ace9d-2597-436b-8f79-edddcd663f8c."},

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    If you have any other plugin or workflow which triggers on create of opportunity and then updates the opportunity then this could happen. You could validate/ isolate this buy creating an opportunity directly ( i.e. not through lead qualification) and see if your still see both create & update.

    Regarding the errors, it is something to do with some user. You need to find out the users by the Guid mentioned in the error message. "9d5b504c-4b3c-e611-80e7-5065f38ada11" & "860ace9d-2597-436b-8f79-edddcd663f8c."

    Hope this helps.

  • CrmMad Profile Picture
    65 on at

    Yes, this error "...but allowImpersonationOfOrganizationSystemUser == false. ..." is happened from 1 month agowhen you are debugging plugins in sometimes

    However, update event is fired 2 or 3 times when you are creating a new oportunity. This error are happened always......in quote prodcuts and in invoice products are happened also, misteries from Core .... when you have not any update.....

    OOB, 3 times update event is firing in details entity when you are creating a new opportunity or quote or Invoice,........:

     1st) First Dynamics update Quantity elements

    2nd) Second time update product name

    3rd) Third time, I don't know what are doing core dynamics.....

    The solution is use depth >1 or depth>2 for cut the execution plugin , depends on your needs

  • CrmMad Profile Picture
    65 on at

    .

  • Srini20 Profile Picture
    397 on at

    Thanks Ravi. I was able to figure this. There was some problem with Stage operations that i have automated.

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