Conditional protection; usage of OLD_VALUE function

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
greg
Posts: 124
Joined: Sat Apr 23, 2005 12:46 am

Conditional protection; usage of OLD_VALUE function

Post by greg »

I want to add a conditional rule to protect Product business object from changes by some categories of users. I want to protect Product if this Product was ordered before. When a product is ordered, it is linked to OrderItem business object by Product.ProductOrdered attribute. I tried to add this rule to the Product

If OLD_VALUE(Product.ProductOrdered) IS DEFINED
Then PROTECT Product FROM ALL EXCEPT Administrator AND Manager

However the system did not accept IS DEFINED with OLD_VALUE, is it what supposed to be? Can you suggest another way to protect Product?

Thank you.

I am using AwareIM version 1.3 build 693
aware_support
Posts: 7299
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

The work around is to always initialise ProductOrdered to 'No' to make sure that this value is always defined. Then define the following protection rule:

If OLD_VALUE (Product.ProductOrdered = 'Yes') Then
PROTECT Product FROM ALL Except Administrator AND Manager
Aware IM Support Team
Post Reply