question

Aditya Prakash avatar image
0 Likes"
Aditya Prakash asked Ben Wilson edited

Using Global Macro in Query ?

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.

FlexSim 16.1.0
query
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

Maybe different datatype?

0 Likes 0 ·
Aditya Prakash avatar image Aditya Prakash Joerg Vogel commented ·

No Jörg, both are num for sure.

0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
3 Likes"
Jordan Johnson answered Ben Wilson edited

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.

· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Aditya Prakash avatar image Aditya Prakash commented ·
0 Likes 0 ·