Notifications
Announcements
No record found.
I want to enable or disable a Menu Item Button in a form where there are four tables associated. Based on the fourth table and condition where value is greater than 0 only than the menu item button is enabled else disabled. Please kindly guide me for the same
Hi ankitrsharma,
You could put codes:
if(condition){
menuitemname.enabled(false)
}
on Form.Init() method of your form.
Title changed from "Technical help" to "Disable button from code". Category changed from "Manufacturing" to "Development / Customization / SDK".
Doing it from init() method wouldn't do the job - it would happen just once, when starting the form. You want to use active() method of a data source.
Put following code in the active method of the data source of the fourth table:
MyButton.enabled(MyTable.MyField > 0);
Thanks Will. But I have to enable or disable a menu item button. Condition is based on the field jump ref form value. Eg. Transfer order there are two grids INVENTTRANSFERTable and InventTransferLine. Hence if we go to the InventTransferLine table and from there we select the InventDim. WMSPalletID. When we view the details of the WMSPalletID it directs to the WMSPallet form and there we have customized field. On the basis of that field value i need to enable disable the button. Can you kindly guide me for the same. Thanks.
ok sir thanks for the help
you are correct sir. I am doing the same but the condition is
But I have to enable or disable a menu item button. Condition is based on the field jump ref form value. Eg. Transfer order there are two grids INVENTTRANSFERTable and InventTransferLine. Hence if we go to the InventTransferLine table and from there we select the InventDim. WMSPalletID. When we view the details of the WMSPalletID it directs to the WMSPallet form and there we have customized field. On the basis of that field value i need to enable disable the button. Can you kindly guide me for the same. Thanks.
MyButton.enabled(WMSPallet::find(inventTransferLine.InventDim().WMSPalletId).MyField > 0);
(replace inventTransferLine.InventDim() with inventDimShip() or inventDimReceive() if needed).
By the way, perhaps next time you can share all the details already in your first message - this way others can provide more accurate suggestions and you solve your issue quicker.
Hi Nikolaos. Thanks for the same. But the condition is as below.
You don't need to repeat the same thing over and over, everyone can see all messages that you post.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 503 Most Valuable Professional
André Arnaud de Cal... 434 Super User 2025 Season 2
BillurSamdancioglu 278 Most Valuable Professional