web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to retire a produc...
Power Automate
Answered

How to retire a product using Power Automate Cloud?

(0) ShareShare
ReportReport
Posted on by 46
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.
Categories:
I have the same question (0)
  • Verified answer
    fsuarezoedt Profile Picture
    46 on at
    I tried retiring a product using the old Workflows and it works.
     
    As a work around, I created a new true/false field in the table and did a Power Automate flow with the retiring logic and trigger, to change that field.
    The Worflow monitors that field and when it detects a change, it retires the produuct.
     
    I prefer to work only with PA, but since it's not working, I resorted to this trick.
     
    Can anyone help me troubleshoot why PA can't retire the product directly?
     
    Thanks!


    EDT: it turned out that this worked because it was deactivating some products that wasn't auto-reactivating So PA works as expected, and so does Workflows. But I have to figure out what is re-activating the products

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard