Announcements
No record found.
Hi,
In salestablelistpage form generate control, I have added a custom menu item.
I want this particular menu item to be enabled always as i want user to use it while SO is journal type , however it appears that this generate tab items are enabled only after cetrain conditions are met.
Please suggest a fix.
Thanks
Mav
Hi Mav,
The enabling/disabling of this button group is being controlled by SalesTableListPageInteraction class. You can can check setButtonSellMutliSelection method in this class which is enabling/disabling this button group.
You can create a CoC on this method and enable the button group as per your requirements.
I think that is for entire generate control, i want the generate to work as it is , just want to enable my action item always.
Since the button you added is under Generate, if the Generate button group is disabled, this button will be disabled as well. You will need to enable the button group and disabled the other buttons under this group.
It might be easier if you can create a new button group and place your menu item button under it.
You can or move the button to another position on the form or check if there is coding which will disable the whole submenu. If that is the case, you can extend it to enable the submenu and disable individual menu items.
Hi Experts,
If it is that complicated then I will let it work just like oob.so my custom button will be disabled when generate is disabled and vica versa.
How can I get it to work just like other buttons in salestableform which is the underlying form. for example confirmation button. If that is enabled my custom button is enabled and if that is Disabled then my custom button is disabled.
Asking because in this form the issue I m facing is that when oob button is disabled my custom is enabled and I would want it to just mimic the oob behavior.
If you are looking to enable disable the button on SalesTable form, you can do this by creating a CoC on method applyState in class SalesTableFormJournalButtonState and add the condition for your enabling/disabling your button based on the value of enableConfirmationButton.
Yep i saw that switch case, i guess the COC on this method will take care of both salestable & salestablelistpage as this switch statement has cases for both those forms.
Can you please share how to do COC in existing switch case where it would replicate the behavior of enableConfirmationButton.
That's correct. This will take care of both SalesTable and SalesTableListPage forms. You can try doing CoC on this method like this -
[ExtensionOf(classStr(SalesTableFormJournalButtonState))] public final class DEVSalesTableFormJournalButtonState_Extension { public void applyState() { next applyState(); switch (this.parmFormRun().name()) { case formStr(SalesTable): this.enableButton(formControlStr(SalesTable, yourButton), enableConfirmationButton); break; case formStr(SalesTableListPage): this.enableButton(formControlStr(SalesTableListPage, yourButton), enableConfirmationButton); break; } } }
Hi Gunjan,
Wow i did not know that , that you can just add a condition into existing Case for COC. Thanks.
Can you please share how do i get the below salestable in the switch case and add additional logic like below
switch casse
Mimics the existing confirm button behavior to custom button and additionaly below condition
if (salestable.order type == journal) then keep the button enable.
You can check if you have the variable salesTable available in the class in which case you can use it directly.
Else you can try this code -
[ExtensionOf(classStr(SalesTableFormJournalButtonState))] public final class DEVSalesTableFormJournalButtonState_Extension { public void applyState() { SalesTable salesTableLoc; next applyState(); salesTableLoc = this.parmFormRun().datasource("SalesTable").cursor(); if (salesTableLoc.SalesType != SalesType::Journal) { switch (this.parmFormRun().name()) { case formStr(SalesTable): this.enableButton(formControlStr(SalesTable, yourButton), enableConfirmationButton); break; case formStr(SalesTableListPage): this.enableButton(formControlStr(SalesTableListPage, yourButton), enableConfirmationButton); break; } } } }
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 663
André Arnaud de Cal... 439 Super User 2026 Season 1
Syed Haris Shah 337 Super User 2026 Season 1