question

Manuel Sinco avatar image
0 Likes"
Manuel Sinco asked Tay L commented

Is there any code that can select/open a Global Table?

I'm developing a GUI using the dashboard part, so I want to add a custom code that opens a Global table each time the user presses a button.

FlexSim 19.1.0
global tablecustom code
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
1 Like"
Matthew Gillespie answered Tay L commented
applicationcommand("edittable", Model.find("MODEL:/Tools/GlobalTables/GlobalTable1"));
· 13
5 |100000

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

Manuel Sinco avatar image Manuel Sinco commented ·

As ALWAYS it worked. Thanks Matt!!

0 Likes 0 ·
Manuel Sinco avatar image Manuel Sinco commented ·

Another question Matt, is there a similar code to open the Time Tables view?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Manuel Sinco commented ·
treenode timeTable = Model.find("Tools/TimeTables/TimeTable1");
createview("VIEW:/pages/tools/TimeTable Parameters", timeTable.getPath(), timeTable.getPath());
0 Likes 0 ·
Manuel Sinco avatar image Manuel Sinco Matthew Gillespie ♦♦ commented ·

Great! Thanks again Matt!

0 Likes 0 ·
Tay L avatar image Tay L commented ·

Hi Mr. Matthew, Im encountered error msg when using this code: applicationcommand("edittable", Table(""));

Flexscript Error VIEW:/active/GUI testing1054953478/button>OnPress line 1 The function Table is not recognized.

Why?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Tay L commented ·

@Tay L I don't understand what you're trying to do. Table("") doesn't do anything. You have to put the name of the table you want in the Table() constructor. But you should really use my example above which works best.

applicationcommand("edittable", Model.find("MODEL:/Tools/GlobalTables/YOUR_TABLE_NAME_HERE"));
0 Likes 0 ·
Tay L avatar image Tay L commented ·

Hi @Matthew Gillespie thanks for the quick response.


If I use the code below:

1633484222215.png


This is the error:

1633484239115.png



If use the code:

1633484265938.png


The table display NULL, and the error mesage belwo:


1633484312208.png


Thank you.


0 Likes 0 ·
1633484222215.png (12.4 KiB)
1633484239115.png (14.5 KiB)
1633484265938.png (8.7 KiB)
1633484312208.png (20.9 KiB)
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Tay L commented ·
@Tay L What version of the software are you using? If you're using an older version you should replace Model.find with model().find
0 Likes 0 ·
Tay L avatar image Tay L Matthew Gillespie ♦♦ commented ·

Im using Flexsim 7.3. After i use model().find, the table shows NULL and error message :

"Flexscript Error VIEW:/active/GUI testing564263746/button>OnPress line 1 The method find is not recognized"


0 Likes 0 ·
Show more comments