Deactivating Dynamics 365 records in PowerApps Canvas App

Free PowerApps Dynamics 365 Training Guide:

Deactivating Dynamics 365 records in PowerApps Canvas App

You can try this possible solution here

If you want to try to do it from the Canvas App directly and not from a Flow:

Try Patch from PowerApps Canvas with the values it expects for "statecode" attribute of the entity.*

Remember it’s not called Active or Inactive in Dynamics. You may need to actually patch a number of zero or one.

Example: Account Entity Reference:

Dynamics 365 PowerApps Canvas App Training

NOTE: This may or may not work to Patch the statecode from PowerApps to the Common Data Service record, it may depend onthe circumstances and it may depend on some caveats, and due to those circumstances it is best to try it yourself now with a grain of salt – this may or may not work. If you need help you can contact us for more info

Also NOTE: If the above doesn’t work with Dynamics 365 data source- try the above instead using the Common Data Service data source. You are able to use Common Data Service source while using Dynamics 365 – in fact we recommend you use Common Data Service over Dynamics 365 in all Flows (especially Power Automate or Flow because you can set the "Current" environment as the scope in all the Flow Actions, making the solution more portable), as well as PowerApps Canvas Apps.

If it works, you can deactivate Dynamics 365 record without even using a Flow and by using PowerApps Canvas App directly!

See more Dynamics 365 PowerApps Canvas App Training