Hi
We have Dynamics 365 and we want to retire products meeting a certain criteria using a flow.
But when I try to "Update a row" changing the statuscode to Retired I get an error:
2 is not a valid status code for state code ProductState.Active on product with Id de2566b6-c407-e811-810f-5065f38be551.
If instead of statuscode I use statecode, the action executes without error, but the actual value is not changed (this is the output of the update action):
"statecode@OData.Community.Display.V1.FormattedValue": "Activo",
"statecode": 0,
If I change statecode and then statuscode in different actions, I get the same error (probably because statecode is not changing).
I can retire a product using CRM (one by one), and when I set a product as Retired, I see:
"statuscode@OData.Community.Display.V1.FormattedValue": "Retirado",
"statuscode": 2,
"statecode@OData.Community.Display.V1.FormattedValue": "Retirado",
"statecode": 1,
And if I change both statuscode and statecode in the same action, PA says "successfully", but the actual values are not changed at all, so the product is still active after the update.
So, is there a way to retire a product from Power Automate?
EDT: it turned out that PA was working but something in the background was re-activating the product.