question

Stan Davis avatar image
0 Likes"
Stan Davis asked Stan Davis commented

Move Find Slot Query into Code Editor

I have a long Find Slot query that is difficult to view in the little query window. I'd rather view it all at once in a code window. How do I place it in the Find Slot activity's Code Editor instead?

I've placed this shortened version in the Code Editor for testing but it does not work correctly and I get 'syntax error, unexpected integer, expecting end of code' error.

Storage.system.findSlot("WHERE $1.PartNo IN (slot.PartNo1,slot.PartNo2) AND slot.hasSpace($1.item) ORDER BY RAND()", 0, token);

Thanks.

FlexSim 23.0.2
sql queriesfind slot
5 |100000

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

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Stan Davis commented

You just need to return the query string:

return "WHERE $1.PartNo IN (slot.PartNo1,slot.PartNo2) AND slot.hasSpace($1.item) ORDER BY RAND()";
· 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.

Stan Davis avatar image Stan Davis commented ·
worked perfectly. Thanks Jason.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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