Hey there.
I have a business problem. I need to execute custom code that sends a JSON object from CRM to an external API. The API will then respond one with 1 useful field I need to bring into CRM and update.
In the past I have used a custom workflow that is triggered by JavaScript to perform what I need. So the flow was JavaScript -> Process -> Within the Process Trigger my Custom Workflow Assembly -> Update the entity field.
However, as I've been reading online people say plugins are more useful? Why is this? I've created a JavaScript -> Custom Action -> Plugin Code... but I can't get good error logging from it in the plug-in trace log. The action has no steps or parameters. I can trigger the plugin code just fine, but it only works in pre-validation because no record or entity is being created/updated/etc... I just was seeing if this pattern was better than custom workflows and it seems like it isn't.
The button that is being clicked is on a subgrid of my entity.
When I go to the plugin trace-log I can find it so I know the plugin is triggering since I can see my tracelogs. However, it doesn't give me the execution start time. As well as I have it throwing an InvalidPluginException in the plugin to try and get an error dialog when I'm viewing the subgrid/view where I click the button and there is no pop up or failed callback from my JavaScript to trigger the action. Is it because the custom action has no output parameter or steps?
My question really is... why do people say plugins are better? If I'm needing to click a button I feel like executing a custom workflow works a whole lot better for my use-case? It seems to be easier to get a failure on your JavaScript call to the workflow/process since you have to add steps in the custom workflow to trigger your custom C# code. As well as you can look at the process audit log a lot easier when you force an InvalidPluginException or just get a general error for troubleshooting not using the plugin profiler (that is buggy and obnoxious to use)
Can anyone potentially fill in my knowledge gap?