Saving Attribute Value Prior to Being Updated by Rules

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
customaware
Posts: 2392
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Saving Attribute Value Prior to Being Updated by Rules

Post by customaware »

Imagine I have a BO called MyData. I have two attributes..... DataValueCurrent and DataValuePrior

Whenever the BO is Modified DataValueCurrent gets updated in the BO Rules.
I need to save the value of DataValueCurrent into DataValuePrior BEFORE the Rule that updates DatValueCurrent.

At the moment, both end up being updated to the new Current value so seems that because both rules update the BO, then they get rerun.

I have tried to implement OLD_VALUE but that seems like it is for Form editing rather than Rule update.

Any ideas here would be helpful please.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
customaware
Posts: 2392
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Saving Attribute Value Prior to Being Updated by Rules

Post by customaware »

Scrub that.... Solved it..... Was simpler than expected.....

Two BO Rules.....

RULE 1: Update Prior
IF NOT(MyData.DataValueCurrent WAS CHANGED)
MyData.DataValuePrior=MyDataDataValueCurrent

RULE 2: Update Current
MyData.DataValueCurrent=NewValue
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Post Reply