question

Jeremy R avatar image
1 Like"
Jeremy R asked Jordan Johnson commented

Invalid SqlDataSource object when querying backorders

When I try and query for backorders of a Global List using List.pull(), I keep getting the following error messages in the System Console

  1. exception: Invalid SqlDataSource object
  2. exception: getquerymatchtablerow - invalid row index

Notably, the query is running successfully and returning correct results, but in the process it also produces the following error message. Additionally, in the model in which I first noticed this, I could successfully query backorders on one of my Global Lists, but not a different Global List, even when running the exact same FlexScript code to query their backorders (unfortunately, I cannot share that full model).


To try and isolate the cause, I've created a test model (backorder query.fsm) with a brand-new Global List. The following is the code that I'm using to test this.

  1. List testList = List("List1");
  2.  
  3. //Create backorder
  4. testList.pull("WHERE 0", 4, 1, nullvar, nullvar);
  5.  
  6. //Get all backorders
  7. List.PullResult test = testList.pull("WHERE 1", 4, 1, nullvar, nullvar, LIST_PULL_BACK_ORDERS + LIST_DO_NOT_FULFILL);
  8.  
  9. return test;


In 18.2.0, the error occurs every single time I run that code from the Script window. In 19.0.0, the error never occurs with that test model. In 20.1.0, the error always occurs at first, but if I open the Global List and click "Apply" it stops happening.


What is causing these error messages? Since the query is otherwise working correctly, is there a way to suppress the error messages?

FlexSim 18.2.3
sqlflexsim 18.2.3backorder
backorder-query.fsm (17.3 KiB)
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

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Jordan Johnson commented

This looks like a bug. To avoid getting the error message, add a Back Order Queue Strategy.

ORDER BY 1

seems to avoid the issue in this case.

· 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.