Hello All. I am having a problem with a Plugin I wrote some time ago (month or two, Dynamics 365 Online) I had it working before, but needed to update some internal GUIDs the Plugin targets in logic. Prior to adding these new values I tested this Plugin in production with success (actually left it on by accident and worked for a prolonged period, and 5k+ modified records). The plugin was registered on Create for this.
However now when I reactivate the Create Step, I cannot get it to work as before. I have tracing activated and can see that the error is that a key is "not present in the dictionary" and I know this is because the ID for the record is not being populated and therefore empty/null when the Plugin runs. I have attempted different combinations of pre/post and sync/async, but none of the combinations allow the Plugin to function as intended.
For context, the Plugin is fired and picks up the record's ID, using it to make an ODATA Dynamics API (GET) call with a dynamic value/var in the request for the ID, gather data into var, and then output those var/string via a PATCH request to the API. However, it only does this for specific automations using their GUIDs.
The end result is data from one entity into another (has to happen this way as one of the Entities is a ClickDimensions managed entity, with the other being our main entity to hold contacts). The entire thing has worked before, and works on update for each case.
(The Plugin works on Update like magic every time)
How can I get this to work again? Also for a Plugin like this what is the ideal method to use Pre Validation/ Pre Operation / Post Operation and Sync / Async. I had assumed the most Ideal would be Post Op/Async as to allow the ID to manifest, but the logic does not seem to execute.
Apologies for the long post, any/all help is greatly appreciated. Thanks Everyone. (I will update if I manage to get it working again)