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
TRANSLATION REORDER DATE
Stewart
What's a way to reorder a string / date in a translation?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
A few ways depending on the reformatting needed and whether willing to use Tcl or not.
How about an example of what you are attempting?
Stewart
01/02/20 needs to become 20200102
Jim Kosloskey
OK well first of all dates post 1999 are supposed to have the century so there is that to think about (is that 1920 or 2020?). You are assuming 2020 but could it be 1920?
No Tcl (assuming you have decided all of the years are in the 20 cc and never 19):
Use the STRING Action SUBSTRING function to extract the month portion of the date storing the result in a temp variable (let's say
@mm)
.
Then use the STRING Action SUBSTRING function to extract the day portion of the date storing the result in a temp variable (let's say
@dd)
.
Then use the STRING Action SUBSTRING function to extract the year portion of the date storing the result in a temp variable (let's say
@yy)
.
Then CONCAT =20 with
@yy
placing the result in a temp variable (let's say
@ccyy)
.
Then CONCAT
@mm
@dd
@ccyy
placing the result in the destination field.
For Tcl you could do the same thing using string or regsub I would guess. Someone else would need to provide you with the regsub spec.
Do you know how to write an xltmp type Tcl proc that interacts with the Xlate?
Personally I would press the sending system to provide a proper date and eliminate the century concern then use the Xlate Actions outlined above but no need to CONCAT =20 with
@yy
just extract
@ccyy
from source date.
Charlie Bursell
A much simpler way:
set indt 01/02/20
set outdt [clock format [clock scan $indt] -format %Y%m%d]
Stewart
Jim,
I don't know how. In the translation configurator, I see the Pre Proc / Post Proc and have attempted to use this but am having trouble. If I need to manipulate the value of 2(0).1(0).1(0).0(0).OBX(0).#5(0) with the Tcl proc, how do I use this in the Tcl editor?
Jim Kosloskey
Then if this needs to be done right now use the Xlate method I described. Then either take level 2 training or spend some time learning how to write Xlate (xltp) Tcl code.
I don't think this forum is the place for training.
Charlie Bursell
In an Xlate pre proc, assuming the value you are passing contains the date you want to change: Note no error checking for valid date
As Jim said you really need some training
set indt [lindex XlateInVals 0]
set outdt [clock format [clock scan $indt] -format %Y%m%d]
set XlateOutVals [list $outdt]
Stewart
Thanks for all the help.