How to trap Cancel press event for a progress bar

hav
Member Posts: 299
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,
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)
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)
0
Comments
-
Never actually done it, but I think it would be something like this.
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:IF Counter <> 100 THEN //I got here without finishing the processing CancelCleanUp() //Or whatever code you want to use
I hope that helps0 -
First of all thanks for your help.
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:-Open Progress Bar dialog Fetch first record Repeat do some processing update count of records Update progress bar Untill Next record exists Do further processing
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,Regards,
Hemant
MCTS (MB7-841 : NAV 2009 C/SIDE Solution Development)0 -
hav wrote: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,
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.David Singleton0 -
I may be wrong but I imho the dialog box cancel button is designed incompletely.
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?0 -
What about
If not DoSomeProcessing then DoSomethingElse
Function: DoSomeProcessing(return:boolean)
Dialog.Open
...
exit(TRUE)0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions