Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When a user executed an action, I need to verify that he entered correct data in the items fields and cancel the action if the data is not valid. How can I do this?

0
Posted

When a user executed an action, I need to verify that he entered correct data in the items fields and cancel the action if the data is not valid. How can I do this?

0

A.: You can create a shared client macro that will be triggered by the event that is linked to the status change. The macro will check the data and undo the last action (if the data is not valid) by calling the UndoLastAction method of the AQdevTeamCurrentItem object. Note that the UndoLastAction method does not restore the previous state of an item. It just removes the last record from the item’s Audit Trail list. The following script code demonstrates the use of this method. It removes the last record from the item’s Audit Trail list and reassigns the item to the user who executed the last action. [VBScript] Set Item = AQdevTeamCurrentUIItem Set User = Item.GetHistory.Items(Item.GetHistory.Count-1).User Item.UndoLastAction AQdevTeamCurrentUIItem.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123