Dialog window sticks when error comes.

rushabh149
Member Posts: 15
Hi,
I am running the codeunit from a form. In the codeunit I am using dialog window which updates on each record and finally closes.
The problem that happens is that whenever some error occurs(validation, data absence) during the execution of the codeunit error message comes, still the dialog remain open. It looks odd, and I want that whenever some error occurs, the dialog window should close without user intervention.
Thanks in advance
I am running the codeunit from a form. In the codeunit I am using dialog window which updates on each record and finally closes.
The problem that happens is that whenever some error occurs(validation, data absence) during the execution of the codeunit error message comes, still the dialog remain open. It looks odd, and I want that whenever some error occurs, the dialog window should close without user intervention.
Thanks in advance
0
Comments
-
I think it is because you have the codeunit defined as a variable in the form.
If your codeunit has an error, the transaction is undone, but all the variables in the codeunit remain active until you do a CLEAR.
If you run the codeunit with CODEUNIT.RUN, this should not happen because the instance of the codeunit is cleared.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
You can also create the variable as local variable in your function and it will clear automatically.0
-
hi rushabh149,
Its so simple..
when you call codeunit from the form dont create a variable of a codeunit.
just write this way.
use following syntax :CODEUNIT.RUN(CODEUNIT::"dialog test")
when error comes dialog box automatically closed.
Regards,Experience Makes Man Perfect....
Rajesh Patel0 -
Hi,
sorry that i post in this "old" thread but i've the same problem.
the answer of rajpatelbca is correct but i've two problems with that:
1) why occurs this error (!)?
2) how can i use functions of a codeunit in this case?
kind regards,
Matthias
EDIT:
aahhh the scope is the problem......do not use globals
SOLVED0 -
MatthiasKönig wrote:Hi,
sorry that i post in this "old" thread but i've the same problem.
the answer of rajpatelbca is correct but i've two problems with that:
1) why occurs this error (!)?
2) how can i use functions of a codeunit in this case?
kind regards,
Matthias
EDIT:
aahhh the scope is the problem......do not use globals
SOLVED
Yes, the scope is the problem here, because if the variable is still valid, the dialog will not close. If it is in something what is not valid anymore after error, the dialog is disposed automatically...0 -
MatthiasKönig wrote:sorry that i post in this "old" thread
Points in my book for actually searching for a solution before posting your problem. =D>0 -
matttrax wrote:Points in my book for actually searching for a solution before posting your problem. =D>0
-
oh!this is the reason for this to happen!
i've had the same problem a pair of years ago, but i left it unsolved because the problematic object wasn't developed by me...good to know, thanks for pointing this out :thumbsup: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