'Operation error' today during runtime from a rule

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: 2536
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

'Operation error' today during runtime from a rule

Post by Jaymer »

This isn't a showstopper, but i'm wondering what all I need to keep doing to this... (rhetorical).
I just wanted a simple entry in the log.
By now, easier to just remove the "OLD_VALUE" stub.

---------------------------------
I added an entry to a log.
Changed it to show date from ---> date to, which errors at runtime because I can't add a string to a date. makes sense.
Added the AS_STRING around that, which works now UNLESS the date is NULL
Works in testing until the users find an OLD record without a value. Runtime error.
So now I'd have to add a EVAL_EXP to check to see if the OLD_VALUE is null.... etc etc

Code: Select all

JobNote.Note	= 'Modular Delivery Date Change: ' + Job.wmDateModularDeliv   // works
JobNote.Note	= 'Modular Delivery Date Change: ' + OLD_VALUE(Job.wmDateModularDeliv) +  ' ----> ' + Job.wmDateModularDeliv  // throws "Operands of addition expression are of diff. types"
JobNote.Note	= 'Modular Delivery Date Change: ' + AS_STRING(OLD_VALUE(Job.wmDateModularDeliv)) +  ' ----> ' + AS_STRING(Job.wmDateModularDeliv)  // works
		UNLESS THE Date is null.  Either the AS_STRING or the OLD_VALUE throws a 'Operation error' dialog.
Attachments
Screenshot 2024-08-28 at 11.58.52 AM.png
Screenshot 2024-08-28 at 11.58.52 AM.png (40.6 KiB) Viewed 5209 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
Post Reply