Hi JMP community,
I am facing a quite annoying issue which i cannot seem to solve.
I am working on a dashboard project which has some tabulates and two levey jennings control charts with phases.
I have introduced a new phase and would like the user to be able to re-draw my dashboard using the new phases on my control chart if needed. I do not have a sophisticated way of doing this but I am just closing down the first dashboard using:
rpt<<Close window()
and then i am doing a sort (since the new phases are mixed) :
RealizedDT << Sort(Replace table, By(:Phase, :Process Order),Order( Ascending, Ascending ));
and them i am launching a copy of the script but with the phases switched out in the tabulates and levey jennings charts.
This works fine when I am running my scripts manually, but when I put a button on the first dashboard to run through all the steps (close, re-sort and redraw) I get a JMP access violation error and everything crahses.
If I am removing the re-sorting step the access violation issue is gone (but i cannot draw my levey jennings because the phases are not sorted).
It looks like the resorting takes place before the first dashboard is closed (eventhough the close window() is the first line of code). When I run my code without the resorting I see that my new dashboard is created and named Dashboard2 and then the first one seems to be closed. Is it because all graphics are only handled after all code is executed?
So, in conclusion I have two questions for you:
Could this be the reason for my access violation issues?
Can I somehow force JSL to close the first window before continuing with the rest of code?
Thanks in advance, your help is invaluable 
Daniel