Hello All,

I am trying to do Custom Pricing at the opportunity product level to change the extended amount based on our requirement.

I have tried the sample plugin Sample: Calculate Price plug-in | Microsoft Docs and disabling the pricing in setting. When I created the sample plugin the plugin is going into the Infinite loop and throwing different exceptions like below

Exception Message: Object reference not set to an instance of an object.

ErrorCode: -2147220956
HexErrorCode: 0x80040224

HelpLink: go.microsoft.com/.../

TraceText:
[Microsoft.Dynamics.Sales.Plugins: Microsoft.Dynamics.Sales.Plugins.PostOperationOpportunityCreate]

I have tried to solve these by adding depth and also checking Parent entity SDK Messages and but by adding depth it is stopping other operation too if we create bulk Opp products like calculating the total amounts etc in quote Order Invoice 

Thanks,

Please suggest ASAP.