Hello All,
I had written a plugin code to assign leads to different users based on some conditions.
Registed at
message: create
event: Post Operation
Code is working fine till
=> service.Update(entity);
but it is not making me to save the record/failed to create record through import or any
and throwing an error like:
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Generic SQL error.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ActivityId>d2d4310b-a254-4a90-a74c-efb68c00b40d</ActivityId>
<ErrorCode>-2147204784</ErrorCode>
please help me to solve this asap.
*This post is locked for comments
Hi, You can progress in two ways
1)Please Make sure any other plugin triggering on update of that entity. If so check Plugin Trace Log whether that plugin fails on update of that entity.
There is no proper message on exception which you given, Maybe some other plugin may fail on the same pipeline.
2)Instead of using post operation you can go through pre-event as Andrew Butenko suggested.
Hope it helpful
Resister Plugin on Pre-Operation and change owner filed value based on condition. no need to update it.
Try pre-event and just put new owner to ownerid field without update.
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6