Creating new items via aras.uiShowItemEx doesn´t add LifeCycle data especially for versioned ItemTypes. How to fix?

Hi community,

I have a couple of ItemTypes with a custom LifeCycle. Sometimes when users promote an item to change the "state", the Form will not be updated and will not show the updated data. In this case users always had to click the refresh button to see the updated state.

So the basic situation is something like this:

I discovered that the Form update mainly fails when the item was created via a custom client Method. AND: In addition it only fails if the target ItemType is versionable. 

Here are some simple steps to reproduce the scenario. Let´s assume we have following code that we can directly execute from a client Method:

const newItem = aras.newItem("Manufacturer","add");
aras.uiShowItemEx(newItem, "tab view");

The code will add a new item and opens it in a new tab. User than can save the item and promote it to another state.

- If the ItemType is something like Manufacturer, Form update will work after item promotion.
- If the ItemType is versionable like Part or Document the Form update will NOT work. 

I checked the context item that is used for promotion. I noticed that for versionable items the LifeCycle data is not included in the context item when we come from a custom Method. 

When using promote, the context item should contain information about the used LifeCycle like this:

But the life cycle State information is missing when promoting a versionable item that was created by Method

I wonder if this is a bug in innovator or if I forgot something in my Method code. The update error does not occur for of items that were created via the regular "New item" button.
I assume the missing LifeCycle data causes the problems with the Form update. Does anyone know how to improve this one?

Thanks for any hint!

Angela

Parents
  • I think I found a solution by social engineering and my own magnificence.Sunglasses

    I remembered one of my golden rules of Innovator:
    -> Rule #7 – “There is always trouble when a revision shows up. You either need to use extra code – or Aras messed it up ootb. “

    The shown code concept is pretty old. Same for the behavior of LifeCycles and Forms in general. So the founding fathers probably messed it up by themselves, but it was 20 years ago. Therefore there has to be a solution that is used for years by Aras itself.

    Thanks to this logical conclusion, I was able to find something suitable in the PE Methods.

    Et voilà: Add this line after creating the new item:

          aras.itemsCache.addItem(newItemNd);

Reply
  • I think I found a solution by social engineering and my own magnificence.Sunglasses

    I remembered one of my golden rules of Innovator:
    -> Rule #7 – “There is always trouble when a revision shows up. You either need to use extra code – or Aras messed it up ootb. “

    The shown code concept is pretty old. Same for the behavior of LifeCycles and Forms in general. So the founding fathers probably messed it up by themselves, but it was 20 years ago. Therefore there has to be a solution that is used for years by Aras itself.

    Thanks to this logical conclusion, I was able to find something suitable in the PE Methods.

    Et voilà: Add this line after creating the new item:

          aras.itemsCache.addItem(newItemNd);

Children
No Data