Forum Discussion

shwnhlgn's avatar
shwnhlgn
Ideator III
9 years ago

Effective Date Field

Looking into a solution to turn the effective_date field to a null when a lifecycle state is occurring. I'm assuming I need put a server method on a lifecycle transition, but I am having trouble writing the proper code in C#. The issue is when the lifecycle states are changing, but there is no actual change to the item. When the item changes it's not an issue because the effective_date field automatically becomes null when the item reverts to Preliminary state.

2 Replies

  • Yes you can definitely add a server method on a lifecycle transition you can do a pre or a post, not sure it is important here. For the code, not to give you the whole solution I would say:
    1. get your item ID ( a simple  this.getID())
    2. start an edit query (Item myItem = this.newItem("blabla", edit); myItem.setID(this.getID());)
    3. add the null command on the effective date property
    4. and Apply !