[SOLVED] Why would a simple IF ... WAS CHANGED rule fail?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

[SOLVED] Why would a simple IF ... WAS CHANGED rule fail?

Post by Jaymer »

Screen Shot 2020-03-28 at 2.34.48 PM.png
Screen Shot 2020-03-28 at 2.34.48 PM.png (14.33 KiB) Viewed 4686 times
I'm grasping at straws... so originally I had
IF TicketR.ps_MainResource WAS CHANGED AND TicketR.ps_MainResource IS DEFINED THEN

The "was changed" was crapping out (like it does above), but the IS DEFINED would evaluate TRUE. Overall it was false and not executed.

I'm in Edit mode. The record was already created with a null Main Resource. I'm just trying to run a process when they SET it, but not when they UNSET it.
Last edited by Jaymer on Mon Mar 30, 2020 4:08 am, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Why would a simple IF ... WAS CHANGED rule fail?

Post by Jaymer »

Apparently this has something to do with check a REFERENCE FIELD using WAS CHANGED.

I modified my rule:
Screen Shot 2020-03-28 at 2.47.47 PM.png
Screen Shot 2020-03-28 at 2.47.47 PM.png (16.89 KiB) Viewed 4685 times
Now it evaluates... but incorrectly for what I need.
I physically changed the empty Reference ComboBox to a value - so ps_MainResource did in fact change, and I have the combo box set to SAVE FORM on Change. It saves, rule evaluates.

I'm missing something here.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Why would a simple IF ... WAS CHANGED rule fail?

Post by Jaymer »

never noticed this before... 5 diff rules failing -- all of them checking a Reference field for a CHANGE
Screen Shot 2020-03-28 at 3.17.25 PM.png
Screen Shot 2020-03-28 at 3.17.25 PM.png (95.63 KiB) Viewed 4682 times
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
himanshu
Posts: 686
Joined: Thu Jun 19, 2008 6:24 am
Location: India
Contact:

Re: Why would a simple IF ... WAS CHANGED rule fail?

Post by himanshu »

What AIM version you are running?

I tested IS DEFINED AND WAS CHANGED both... found no issues. The only difference was I test both conditions separately.
From,
Himanshu Jain


AwareIM Consultant (since version 4.0)
OS: Windows 10.0, Mac
DB: MYSQL, MSSQL
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Why would a simple IF ... WAS CHANGED rule fail?

Post by Jaymer »

Latest Build 2721
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

this one works

Post by Jaymer »

I think we've all done this plenty of times.
this SHOULD work, like it does here in this different example:
Screen Shot 2020-03-29 at 11.24.57 PM.png
Screen Shot 2020-03-29 at 11.24.57 PM.png (33.45 KiB) Viewed 4621 times
Very similar rule - this one is a Dynamic check.
The one that is failing is not.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 1996
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: [SOLVED] Why would a simple IF ... WAS CHANGED rule fail

Post by Jaymer »

Issue can be see in the image above with 5 errors in the log.

The top one is the rule "LOCAL_KanBan"... its using TicketR.ps_MainResource

The other rules use TicketGroup.ps_MainResource

All of the "TicketGroup" rules are automatically sync'd by Aware to all Group members.
Since I had a LOCAL Rule that was ONLY for group member TicketR, I made the rule explicitly refer to TicketR - thats technically correct.

Aware must have some internal confusion when this is done - I changed them all to TicketR and it worked. Then changed all back to TicketGroup and it worked.
So I'll have to be more careful with my LOCAL rules so I don't mess up the internals.
Click Here to see a collection of my tips & hacks on this forum? Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
eagles9999
Posts: 2235
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: [SOLVED] Why would a simple IF ... WAS CHANGED rule fail

Post by eagles9999 »

Good work Jaymer.
Cheers,
Mark
_________________
AwareIM 6.0, 8.4, 8.6 (build 2920) MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Chrome, Edge
Upcloud
Image
Post Reply