How to make an form active from other form?

kaustubhk
Member Posts: 6
hii
I have purchase Invoice form..In the purchase invoice i have a button"Button 1"...In purchase invoice subform..If i delete some lines..I want the button to get disabled automatically..I tried to call a function on On Delete trigger of Purchase Invoice subform..I guess the Purch Invoice form is not get activated is there a way out..awating reply
I have purchase Invoice form..In the purchase invoice i have a button"Button 1"...In purchase invoice subform..If i delete some lines..I want the button to get disabled automatically..I tried to call a function on On Delete trigger of Purchase Invoice subform..I guess the Purch Invoice form is not get activated is there a way out..awating reply
0
Comments
-
[Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
You cannot call the mainform from the subform.
If you want to do this, you need to do that using a singleinstance codeunit. The subform sends some info into it and the mainform gets the info from it by using some code in the OnAFterGetCurrentRecord-trigger or the OnTimer trigger.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Haven't tried but you could do something like this:
1. Create a global bool variable on the subform (var1)
2. When the delete is done set var1 to TRUE
3. Create a function on the subform (GetVarValue) whith this code: EXIT(var1)
4. From the mainform call the GetVarValue function to know if you have to disable the button
Salut!Laura Nicolàs
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.0 -
I think the correct way to do this use OnTimer trigger of mainform because if you go anyother way there must have refersh problem either you have done it perfactly.
as far as my personal experience that i have tried.0 -
Don't go hacking away with these kinds of things. the best way is the Navision way : don't try to enable or disable the button, but have the code that is called from it check if there are lines or not, and give an appropriate message to the user. Easy, and no messing about with timers etc.0
-
Hi,
If the requirement is absolutely required, search the forum for "Update Main form from subform using XML"
Here is one of the topics returned:
http://www.mibuso.com/forum/viewtopic.php?t=22564&highlight=
You can use the XML solution that is suggested by Garak, it works perfectly
Regards,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
Thnks solved0
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