Just another WordPress site
New d365fo.integrations cmdlet: Invoke-D365ODataEntityAction

New d365fo.integrations cmdlet: Invoke-D365ODataEntityAction

One of the newer commands added to the #d365fo.integrations module is the Invoke-D365ODataEntityAction, which can call OData actions. This is neat, because it allows us to automate more. In this post I’ll briefly describe how to use it.

Be mindful of case-sensitivity on entity names, actions etc. when using the modules.

In order to find entities with actions, use the Get-D365OdataPublicEntity and filter the results down to one that you want to take action on:

I’ll use the DualWriteProjectConfigurations as an example and dive into that:

The DualWriteProjectConfigurations entity has the following actions:

Lets expand two of the actions, ValidateCurrentUserRole and ValidateAppUsers

The ValidateCurrentUserRole does not have any parameters. What you will see in PowerShell is a default parameter that you do not have supply in your payload. The second action I expanded does have 1 parameter, but still shows the default one. In our payload to the ValidateAppUsers action, we only have to supply 1 parameter, the appIds.

Lets try out the new commands from #d365fo.integrations: Invoke-D365ODataAction with these two actions

Here’s the small test I did.

I hope Microsoft adds more endpoints we can use to validate, verify and set up configuration through automation, so that we can spend less time doing non-value-adding tasks.

Remember, you can find the #d365fo.integrations module here: https://github.com/d365collaborative/d365fo.integrations.

Stay safe out there.