Using Global Macro in Query ?

Using Global Macro in Query ?

aditya_prakash1
Not applicable
15 Views
4 Replies
Message 1 of 5

Using Global Macro in Query ?

aditya_prakash1
Not applicable

[ FlexSim 16.1.0 ]

Why query doesn't support Global Macros ? When I write this "WHERE (puller.active_flag == ON AND shift_query == ON)" instead of "WHERE (puller.active_flag == IsActive() AND shift_query == IsActive())" flexsim gives the error "exception: Invalid SqlQuery object". On the other hand IsActive() query works perfectly.

PA: IsActive() just returns the global macro ON.

0 Likes
Accepted solutions (1)
16 Views
4 Replies
Replies (4)
Message 2 of 5

joerg_vogel_HsH
Mentor
Mentor

Maybe different datatype?

0 Likes
Message 3 of 5

aditya_prakash1
Not applicable

No Jörg, both are num for sure.

0 Likes
Message 4 of 5

JordanLJohnson
Autodesk
Autodesk
Accepted solution

This is a known issue. If you are using the query command in FlexScript, you can use the $ syntax, and use the macro as an appropriate argument.

query("WHERE puller.active_flag == $1 AND shift_query == $1", ON)

If you are using the Pull From List activity in Process Flow, you can make a user command, as you demonstrated above. You could also look in to using a list field.

.


Jordan Johnson
Principal Software Engineer
>

Message 5 of 5

aditya_prakash1
Not applicable
0 Likes