question

Kari Payton avatar image
0 Likes"
Kari Payton asked pc neo answered

Help with query exception error

warehouse-example-kapa-april-24-2018-v-3.fsm

Hello. I'm trying to query a list for items in a specific location and for a specific value. If the criteria is met, the items are loaded and if no items for that specific location then the model moves on. I'm getting this error and don't know what I am doing wrong or what it means. Appreciate the help!

time: 121.818097 exception: FlexScript exception: Property "dataType" accessed on invalid node. at MODEL:/Tools/ProcessFlow/ProcessFlow/Query List for Items in Storage Location>variables/codeNode
FlexSim 18.1.0
exceptiondatatype
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

pc neo avatar image
0 Likes"
pc neo answered

It seems that the error appears in your "Query List for Items in Storage Location" custom code whenever the Table.query returns empty result and it tries to clone the result.

To avoid the error you will need to check the result before you clone it as below.

Table t = Table.query("SELECT AxaptaName, StorageLoc, Proc1, Qty FROM MasterList WHERE StorageLoc == $1 AND Proc1 == 1 ", token.pickOrderLoc);


Table n = Table("Operator1TL");


if (t.numRows == 0 ) {
n.setSize(0,0);
//t.cloneTo("Operator1TL");
}
else {
t.cloneTo(n);

}

5 |100000

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