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
Passing fields into xlt proc
Jason Russell
I'm trying to pass an entire field (PID-3 to be specific) into a TCL proc via an XLT copy method. My biggest issue is I want to pass the entire field (including all repeats) into the proc to do some work with it, and send back out the correct name values. Is there a way to accomplish this, or am I going to have to do the work before the XLT?
Find more posts tagged with
Clovertech
Comments
Jim Kosloskey
ITERATE over the field and apply your proc at each repetition for the name components. May not even need TCL depending on what you are trying to accomplish.
Jason Russell
I suppose that's going to be the 'best' way, was attempting to filter out all but certain Assigning Authorities, and keep that in a centralized location. So we could have (In PID 3):
1234^^^A^~2345^^^B^~3456^^^C
In some cases we'd want A, some we'd want B, and sometimes both. I'm coming from the standpoint of attempting to keep everything as centralized as possible so if there is a change, we only change it a few times rather than on every single interface.
Jim Kosloskey
Well you have options. I am on the road now but if you email me with your tel # we can chat and cover options as I see them.
Charlie Bursell
This may not be as elegant as you like but if you want all iterations in one place you could do something like:
{ { OP COPY }
{ ERR 0 }
{ PRE {
set fldList ""
}}
@{ IN
@null
}
@{ OUT
@null
}
}
{ { OP ITERATE }
{ BASIS 0(0).PID(0).#3 }
{ VAR %f1 }
{ TYPE field }
{ BODY {
{ { OP COPY }
{ ERR 0 }
{ PRE {
lappend fldList $xlateInVals
}}
{ IN 0(0).PID(0).#3(%f1) }
@{ OUT
@null
}
}
}}
}
{ { OP COPY }
{ ERR 0 }
{ PRE {
foreach fld $fldList {echo $fld}
}}
@{ IN
@null
}
@{ OUT
@null
}
}
The output of the last echo statement, used for demo only, is:
1234 {} {} A {}
2345 {} {} B {}
3456 {} {} C
Note you need to init the variable since all variables in Xlate are global.
System
Originally posted by Former Clovertech member
We have a few xlt.tcl procs that accept the literal path as a parameter.
For example the source input is:
=
1(0).0(0).PV1.#7 (note the leading "=")
The xlt.tcl uses xpmfetch for access to that path. This is the main part:
proc xltFormatIdName {} {
upvar xlateId xlateId \
lassign $xlateInVals path
for {set i 0} {$i < 1000} {incr i} {
set datumLst [xpmfetch -warn w $xlateId $path\($i\)]
...
In this example datumLst gives you the entire contents of PV1:7. I didn't write this proc, but I've used it many times.
Jason Russell
Thank you all for your responses! David, yours might just be what I'm looking for, I'll play with it a bit and respond back!
Jason Russell
Is there any documentation on xpmfetch?
Jim Kosloskey
It is in the provided doc under XPM Functions I believe.