question

Ruben Mariduena avatar image
0 Likes"
Ruben Mariduena asked Matthew Gillespie answered

How to write on parent token label using custom code?

I'm running a subflow and every time the child token goes through the custom code I want to change the label data on the parent token. It's pretty much what you do on the "Assign Label" activity "Assign labels to Token: parent" but I need to be able to do this in the "custom code" activity. The reason is because I'm running queries and calculations on multiple labels and it would much easier if I could do this there.

FlexSim 16.2.2
labelscustom codesubflowlabel assignmentparent token
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

Matthew Gillespie avatar image
2 Likes"
Matthew Gillespie answered

In 17.0 and later you would just use the parent property on the token:

token.parent.MyLabel = 5;

Before 17.0, you'll need to use the getparenttoken command:

setlabel(getparenttoken(token), "MyLabel", 5);
5 |100000

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