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
0
Comments
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.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
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!
Author of the book Implementing Dynamics NAV 2013
Cursos Dynamics NAV (spanish) : http://clipdynamics.com/ - A new lesson released every day.
as far as my personal experience that i have tried.
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,
Willy