Hi Trieu,
Oh, in this case, I believe the method you're looking for is in the class
PurchTableForm, method enableUpdateJournalButtons().
It says:
/// <summary>
/// Sets the enabled property on buttons used for posting purchase orders.
/// </summary>
This method is called when you click the posting button on the form:
\Forms\PurchTable\Designs\Design\[Group:Table]\[ButtonGroup:ButtonHeader]\[MenuButton:ButtonHeaderUpdateNow]\Methods\clicked
The values (enable or disable) come from the method purchtable.checkIfUpdate
(it returns a container).
This in turn call the method PurchTableType.checkIfUpdate(), which calls the
method purchTableType.canInvoiceBeUpdated().
Hope this helps.
Best regards,
Klaas.
----------------
http://www.artofcreation.be
Post by Trieu nguyenHi Klaas,
Thanks you so much for your reply. I find in active method but I do not see
ButtonHeaderUpdateNow(Posting) in here and I want to find exactly the method
will disable/enable menuitembutton (Purchase order,Invoice,Packing slip etc).
I find in document I see I must override
PurchTableType.CanInvoiceBeUpdated().. for enable/disable for menuitembutton
invoice .. but I can not find method in purchTable will call this method ?
Thanks and best regard
Trieu nguyen
Post by samsHi Trieu,
Go to your button in the AOT, and set the Autodeclaration property of the
button to Yes. This will make sure you can modify the properties of this
button from code.
Go to the form datasource and overwrite the method 'active'.
In this method you can enable/disable the button depending on values of the
if(purchTable.purchStatus == PurchStatus::invoiced)
{
yourbutton.enabled(true);
}
else
{
yourbutton.enabled(false);
}
- yourbutton == the name of the button control you set the autodeclaration
property to yes of.
- enabled() == the method that lets you enable and disable controls on a form.
Hope this helps,
Best regards,
Klaas.
----------------
http://www.artofcreation.be
Post by samsHi Trieu
I assume the 'enabled(true/false)' property on the menuItemButton Object is
used for that ... if this was your question (which I don't be sure about ..).
Regards
Patrick
Post by Trieu nguyenHi Sams,
Thanks you so much for your reply. I am very confuse with your answer. I
aleady click in PurchTable form and I click in purchase order after that I
click in Posint-> Invoice or Packing slip.. I want to find exactly the
system method will use for disable/enable menuitem in this form ? I already
find method (Click) of menuitem group but I do not see the method will
disable/enable the menuitembutton .
Thanks and best regard
Trieu nguyen
Post by samsHi Trieu,
Have a look at Forms\LedgerJournalTransVendPaym\enableButtonsActive
and http://msdn.microsoft.com/en-us/library/aa882795.aspx.
Hope this helps.
Post by Trieu nguyenHi All,
I am a newbie in ax programmer. I want to find exactly the method will
disable/enable menuiem or another control in ax for example : when I click
purchase order with status Invoice, I can not select Posting ->Invoice or
Packing slip, and when I click purchase order with status purchase order I
can select Posting ->invoice, packing slip.. How can I find exactly method in
system will use for disable/enable menuitembutton or another controls ?
Thanks and best regard
Trieu nguyen