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
Inline Tcl with Xlate Copy
Rich Brant
I'm using a Copy in an xlate, and want to make 20260504 look like 2026-05-04
I've tried $inval, $invar, and $var.
[string range $inval 3]-[string range $inval 4 5]-[string range $inval 6 7]
Version 20.1, and getting an error:
ESSAGE 1
Tcl callout error
[string range $inval 3]-[string range $inval 4 5]-[string range $inval 6 7]
:
errorCode: TCL LOOKUP VARNAME inval
errorInfo:
can't read "inval": no such variable
while executing
"string range $inval 3"
invoked from within
"[string range $inval 3]-[string range $inval 4 5]-[string range $inval 6 7]"
<End of errorInfo>
Find more posts tagged with
Clovertech
Comments
Jason Russell
The variable you're looking for is xlateInVals which is a list. If you are 100% certain you will always pass in a 8 digit date, you can use TCL's clock command:
set xlateOutVals [ list [clock format [clock scan [lindex $xlateInVals 0] -format %Y%m%d\] -format "%Y-%m-%d"\]\]
From the inside out:
lindex gets the first item of the list passed in via xlateInVals
Clock scan will scan that in the format given (YYYYMMDD)
Clock format will format that scanned time in the format given (YYYY-MM-DD)
List recreates the list for xlateOutVals.
Jason Russell
I edited too many times (the bbcode was trying to format the list command). here's the code without the slashes:
set xlateOutVals [ list [clock format [clock scan [lindex $xlateInVals 0] -format %Y%m%d] -format “%Y-%m-%d”]]
Rich Brant
Does pre/post matter in that scenario?
Jim Kosloskey
Yes, you want pre.