Forum Discussion

hkhan's avatar
hkhan
Creator II
4 years ago
Solved

Promoting previous generation

Hello Im trying to promote a previous version of an item programatically can someone tell me how can i do that?
  • Gopikrishnan's avatar
    4 years ago

    Hi Hkhan

    Can you give the specific use case of this ? On which event you want to trigger this method ?

    You can run below method to promote the item. (Ensure that, you elevate the logged in user based on the life cycle promotion role)

    Item previousItem = innovator.newItem("Part","promoteItem");
    previousItem.setID("ID of Previous Generation");
    previousItem.setProperty("state", "Superseeded");
    previousItem = previousItem.apply();

    Thank You

    Gopikrishnan R