How to close a Form defined as a variable....

NR
Member Posts: 78
In the Form "Payment Journal",
I have created a Global Variable "GLReconcile" with Datatype as Form and Subtype as "Reconciliation"
I have added a Menu Item in the Payment Journal which triggers the form through the following C/AL
GLReconcile.RUN;
After the form has been executed, I want to close this form which has been run by using the C/AL .
My query is how can I close this Variable "GLReconcile",as there is no function "Close" for this variable.
Thanks in advance.
I have created a Global Variable "GLReconcile" with Datatype as Form and Subtype as "Reconciliation"
I have added a Menu Item in the Payment Journal which triggers the form through the following C/AL
GLReconcile.RUN;
After the form has been executed, I want to close this form which has been run by using the C/AL .
My query is how can I close this Variable "GLReconcile",as there is no function "Close" for this variable.
Thanks in advance.
0
Comments
-
If I understand your question, you want to open a form from code. Then do some processing and have the code close the form. Right?
Try the following:
1. Create a function on the form:
CloseForm:
CurrForm.CLOSE
2. Call this function from your code.There are no bugs - only undocumented features.0 -
Thanks for the reply.
I followed the solution stated by you, but it gives an error "The form is not open"
I ll tell you exactly in which form I am getting stuck
Payment Journal > Posting > Reconcile.
Here, Reconcile Form is opened from a C/AL code from within the Payment Journal.
I am using this form for some other functionality also, and hence I want to close the Reconcile Form from Payment Journal.
Kindly advice.....0 -
NR wrote:I followed the solution stated by you, but it gives an error "The form is not open"
So you should put a SLEEP after the form.RUN.
This way the form has the time to open. (I think this helps but I am not sure).
It is possible you have to put the closing of the second form in the OnTimer-trigger of the first. And use a boolean in the first form to say it's ontimer-trigger must close the second form.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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