Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

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

Posted on by 395

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

  • Srini20 Profile Picture
    Srini20 395 on at
    RE: Opportunity Plug-In Create and Update - Plug-in Registration Profile Debugging

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

  • CrmMad Profile Picture
    CrmMad 65 on at
    RE: Opportunity Plug-In Create and Update - Plug-in Registration Profile Debugging

    .

  • CrmMad Profile Picture
    CrmMad 65 on at
    RE: Opportunity Plug-In Create and Update - Plug-in Registration Profile Debugging

    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

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Opportunity Plug-In Create and Update - Plug-in Registration Profile Debugging

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans