infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Cloverleaf
Suppress based on date
System
Originally posted by Rich
Team,
I need to suppress messages based on date, meaning if the message coming in is older than 30 days. I don't know how to format the condition based on the MSH.7 value. Can you assist?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
Do you want to do this in an Xlate or Tcl?
If in an Xlate and depending on what release of Cloverleaf you are using, the STRING Action and some other Actions could possibly do the trick.
A lot depends on how the MSH-7 field is really formatted in the messages. Not all systems follow the Date/Time format prescribed for the MSH Date/Time field. SO how is yours formatted?
System
Originally posted by Rich
Hi Jim!
I should have known that you and that gorgeous car would show up! I'm using version 20.1, and MSH.7 is formatted 20221209091927 - Year/month/day/time. Thank you so much for your time!
Jim Kosloskey
I think the Xlate STRING Action xlateStrCalcAge Function should work.
Oh and thanks for the compliment regarding my 1974 DeTomaso Pantera L.
Jim Kosloskey
I actually checked that STRING Function and it reports back number of years so that won't work for you.
Charlie Bursell
Why would you want to incur all of the processing up through Xlate just to kill it? A simple proc in the IB tab would solve it. Just extract MSH.7, do the math and return KILL if over 30 days.
Take a look at the clock command for how to do this. Off the top of my head see below. There may be more eloquent methods.
set msh7 20230210123212 ;#MSH 7 value
# make it scanable then get seconds
set then [clock scan "[string range $msh7 0 7] [string range $msh7 8 end]"]
# Seconds now
set now [clock seconds]
# Number of seconds in 30 days
set 30days 2592000
if {[expr $now - $then] > $30days} { return KILL }