Notifications
Announcements
No record found.
Hello,
I have attached a new button in the ProdTableListPage's action Pane. I need to write a clicked method to stop any active jobs on the selected production record.
I only find a Command property for that button but I dont know where exacly is that method supposed to be modified/coded?
Thanks a lot before hand for your kind help
You have two options:
1) Add your code in the related ListPageInteraction class (you find the class name in the form's properties)
2) Create a MenuItemButton instead of a command button, and write your logic to a separate class.
Option 2 is better because with menu items you can link the button to security privilege and then it's possible to control access to this button via security framework. If you add a command button anyone who has access to the form has access to the button.
Also, CommandButtons are used to launch predefined system commands, such as Refresh and Save.
If you want a button that runs your code, you should use type Button (or even better, MenuItemButton as already mentioned).
Hi Nikolaos,
Let see I get it,
for 1) I found a class called ProdTableListPageInteraction. Hi do I get to called the clicked event refering the button I have created?
2) For a menu item, with having a main(args) that would be enough to put my code (that would be my Clicked event)?
1) Quick googling resulted in this: stackoverflow.com/.../how-to-add-a-method-for-the-click-event-of-a-button-placed-on-action-pane-of-a-l
Please note that if you add the clicked method, your list page can't be used in Enterprise Portal anymore
2) Once your MenuItemButton is clicked, the main method of your class is executed. There you can get the prodTable record by _args.record().
I have followed your recomendation. I added the a menuItemButton and managed to code the basis of what I need ( update the custom NoYes record after button clicked)
1) I wonder if this code is according to the best practices or I need to improve a little bit ( used the Update_recorset instead of ttsbegin/ttscommit)
2) How do I call the Button control, so I can disable the button after update?
1) Update_recordset is not making much sense since you update only one record (since RecId is unique in each table).
You will always need a transaction (ttsbegin/ttscommit) if you update data. No matter if you use update_recordset or not.
2) Check ProdTableListPageInteraction\setButtonAccess
1) I managed to follow your suggestions. At first time when clicking the button it updates the custom field and also in the list page automatically. this part is ok so far.
2) Now I have used the JmgJobBundle class to stop any active jobs from the production selected when button is clicked. This is also doing ok. but when I try updating the field again in 1)
throws an error that says: Cannot edit a record in Production orders (ProdTable).The values displayed in the form are not current, so an update or deletion cannot be made. To view the current values, on the Command menu, click Restore or press CTRL+F5.
part of the code inspired by \Clases\JmgTermCloseOpenregTrans . createStopRegisterationJob()
After running your logic, you should refresh the form data source by calling [formDataSource].refresh() followed by [formDataSource].research(true).
My code is on the class called by the MenuItem as you said I have access only to Main (Args _args)
how do i get to the formDataSource?
I know I ask to much but I am very close to finish . appreciated with your help
Try _args.record().dataSource().
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