Hi all,
I have created a dialog window to display progress bar. The progress bar is working fine
When the progress bar is running and if i press Cancel button on the dialog window, it closes the dialog and terminates any further processing.
What i want to know is how to trap the Cancel button press event while updating the progress bar on a dialog window.
What exactly happens when this event takes place?
Pls answer to the above questions if any one of you know this.
Regards,
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Comments
Your progress bar has a variable that updates until it reaches 100, lets call it counter. If you press the Cancel button then the counter will not be 100 when the next line executes.
So right before the code that executes after the Dialog is supposed to close you could put:
I hope that helps
I agree with you but the doubt still remains.
I am not sure where exactly within the loop the condition to rollback and skip further processing should be written.
For example:-
On pressing Cancel on progress bar,
Q --> The control goes to which statement?
Q --> Does Navision exits the loop?
Q --> Any processing carried out so far is rolled back?
Q --> Any further processing is carried out?
Pls reply to above questions
Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
This is all covered by the Version Principle, there is no "roll back" in Navision. All you need to do is write code according to the NAV guidelines, and all will be fine.
If you use a progressbar for a task where the outcome is not given, you normally want to close it when either you complete your task, or when the progressbar is finished and it times out. Now when you check if you are finished and want to close the bar, the user might alraedy have closed it with the cancel button. There is no way to know that its not there, and the close function doesnt work with "if" and it throws an error. This is really a design error, the close function should allow a "if not dialog.close()" check and not throw an error.
What do you think?
If not DoSomeProcessing then DoSomethingElse
Function: DoSomeProcessing(return:boolean)
Dialog.Open
...
exit(TRUE)