Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

FormCalc var loop

Avatar

Level 6

Hi,

I have some question related FormCalc for expression.

I'm trying to loop trought variable with no luck.

Code:

//take list of user names

var userName= xfa.resolveNodes(concat("$record.empls.empl.[fg_code==""",fgCode,"""].empl_name"))

//loop thriught it

var len = userName.length

for i=0 upto len-1 step 1 do
         xfa.host.messageBox(userName.nodes.item(i))
endfor

not working, i'm getting messages that i can't access properti length or item.

Hoe can I loop trought FormCalc variable?

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Unlike JavaScript, you need to make use of the Ref in FormCals for reference of objects;

I have attached a sample which loops through the items of a node.

Hope it will help you.

Nith

View solution in original post

3 Replies

Avatar

Level 6

Hi,

Friends, is it so hard to make llop trought FormCalc variable? )

Avatar

Correct answer by
Level 10

Unlike JavaScript, you need to make use of the Ref in FormCals for reference of objects;

I have attached a sample which loops through the items of a node.

Hope it will help you.

Nith

Avatar

Level 6

Hi, Nith

Thank you for help. It works )