Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Plugin Execution Context on Form Load

$
0
0

Hi,

I would like to share our experience during CRM development and would like to know the reason or any input on this crm behaviour.

Its quite difficult to explain the issue but let me try to make it simple to understand.

Background

1) There are two plugins on opportunity, one is forcreate opportunity and other works on update of opportunity.
2) Plugin on Create of opportunity was running under Admin user contextwhereas plugin on update of opportunity was running under normal CRM User 'John'(not a system admin) context.
3) Both the plugins Create/Update reads the account record selected as potential customeron opportunity.

Error
1) We were getting an error on opportunity creation as 'SecLib::AccessCheckEx failed. Returned hr = -2147187962'
2) This error was thrown by CRM after creating opportunity record in database and while loading opportunity form with saved details.  
3) When we analysed the error message we found the issue related to privilages.
4) Plugin on create of opportunity was running under system admin context so there was no issue with the privilages available with system admin. Whereas plugin registered on update of opportunity was running under John's context and John was not having access on account selected as potential customer.
5) When we change the user context for update plugin to admin it works fine.

Question
1) Error thrown by CRM is very obvious, but this error should have been thrown by opportunity update plugin and that too on update event of opportunity. In this scenario we have triggered create message and error is getting displayed on form load (formtype = 2 (update)).
2) Do crm reads the update plugin context information on page load (formtype = 2 (update)) even before actual event is triggers?

Any inputs will be highly appreciated!


Vinayak Chavan




Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>