question

Lambert avatar image
0 Likes"
Lambert asked Logan Gold commented

Access labels in the backorders of a list

Hi, I am trying to read the value of a label ("Status") of every backorder item in a list.


I have tried this code with no success:


List Lista = List("MBV");

pt("Lenght: "); pd(Lista.backOrders().length); pr();

for(int i = 1; i <= Lista.backOrders().length; i++)

{

pt(Lista.backOrders()[i].labels["Status"].value);

}


could you please help?

thank you

FlexSim 24.2.2
listbackorders
· 6
5 |100000

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

Jacob W2 avatar image Jacob W2 ♦ commented ·

Hi @Lambert,

Thank you for contributing to our community! We couldn't identify a maintained license or subscription linked to your account.

You may need to update your profile information to identify yourself as a license owner or their associate. Check out our article for how to ensure you receive timely support. If you update your profile comment back to let us know - we'll adjust the priority of your post accordingly.

If your current license is expired, please contact your local distributor to renew.

0 Likes 0 ·
Lambert avatar image Lambert Jacob W2 ♦ commented ·
Hi Jacob, this is my account with the license subscriptions. Should I recreate the question or can you adjust the priority? Thank you
0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann commented ·
As far as I can tell the code from your question should work. Does the list use partitions? You would need to specify the partition id in that case ("Lista.backOrders(id)").

Could you maybe attach an example model so we can check the list settings and pull code?

0 Likes 0 ·
Lambert avatar image Lambert Felix Möhlmann commented ·

Hi Felix, the list is of type resource, hence there are no partitions.

1733240156759.png


Maybe that's the problem?

0 Likes 0 ·
1733240156759.png (96.5 KiB)
Felix Möhlmann avatar image Felix Möhlmann Lambert commented ·

That shouldn't be a problem. According to the reference field it's still a global list.

I can assign and subsequently read labels on backorders without issue in the attached model. Does that work for you? (Run model to generate tokens, then the left script, then the right script)

backorder-label-test.fsm

0 Likes 0 ·
Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Lambert,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

I would try to evaluate label values of a list

a. by a table query

b. by a list query with SELECT clause to get access to field values of this list, otherwise you get only access to the entry value itself. If this value is the ownerobject of your label, then you can read this value.

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

Lambert avatar image Lambert commented ·
Thank you Joerg, could you please help me with the syntax of any of the methods you suggest? I have tried myself and consulted the online help but I cannot make it work.

I am unable to reference the backorders as a list.

Thank you in advance

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Lambert commented ·

@Lambert,

@Felix Möhlmann has described how you can get access to backorders simple data node values. Because it is a backorder, there is not any evaluated field of any entry of your list. You can read by puller value (simple data) of your backorder attributes from this entity like a label.

Nodes_List_backorders.fsm

0 Likes 0 ·