How to use event variables/instance variables in JS code where clause

Avatar

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile
akashaj7696
Level 2

21-03-2021

Hi Everyone,

 

I am trying to write a queryDef code where in I want to filter the records based on the internalName of the previously executed delivery dynamically. Something like below-

 

var query=xtk.queryDef.create(

<queryDef schema="nms:delivery" operation="select"/>

<select>

<node expr="@id"/>

</select>

<where>

<condition expr="@internalName='DM123456' "/>

</where>

</queryDef>.ExecuteQuery();

 

In the above code the "DM123456" i want it to dynamic to an instance/event variable which i can create before.

 

Can someone please help, it will be great if it's possible.

 

Whatever solutions can be provided is highly appreciated.

 

Thanks,

Akash

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile

Avatar
Validate 1
Level 2
akashaj7696
Level 2

Likes

5 likes

Total Posts

29 posts

Correct reply

3 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 3
View profile
akashaj7696
Level 2

21-03-2021

I found the solution myself-

so for using event variable the syntax is below-

<condition boolOperator="AND" expr={"[delivery/@internalName] = '"+vars.internalName+"'"}/>

for instance variable-

<condition boolOperator="AND" expr={"[delivery/@internalName] = '"+instance.vars.internalName+"'"}/>

for a user defined variable, let's say var internalName-

<condition boolOperator="AND" expr={"[delivery/@internalName] = '"+internalName+"'"}/>.

akashaj7696_0-1616395661797.png

 

 

Answers (0)