Hello Experts,
For un editable "Add line" button in SalesLine we use --> SalesLine.allowCreate(false) .
What we use for making un editable "Add lines" button .
Hello Experts,
For un editable "Add line" button in SalesLine we use --> SalesLine.allowCreate(false) .
What we use for making un editable "Add lines" button .
Hi Mohit,
Yes this worked for me.
Thanks Mohit & Girish
Try creating extension class for SalesTableInteraction class, create CoC on enableLineRetailActions method and write below code.
protected void enableLineRetailActions() { next enableLineRetailActions(); if (salesLine.PickingInProgress_CAP == NoYes::Yes) { #SetEnabled(formcontrolstr(SalesTable, retailAddItemMenuItem), False) } }
Right click that method and do find reference and see where it is used, especially in SalesTable form.
Also try adding the logic on onActivated event handler and check.
Thanks,
Girish S.
Hi ,
I think here it is enabling.
Add breakpoint on editSales method in SalesTable form and check if its called after active method. Also, find 'RetailAddItemMenuItem' in SalesTable form and add breakpoints to debug. Standard code will definitely be setting value to True after activated method sets it to False.
Also add breakpoint on enableLineRetailActions method in SalesTableInteraction class.
It seems that somewhere the button is enabled again in the standard code.
See whether there is any standard code available for enabling disabling of the button.
Thanks,
Girish S.
Yes,
I debugged the code it is showing enable false for both buttons.
Have you debugged the code.?
See what is the value of salesLine buffer/
Thanks,
Girish S.
Have you debugged the code? Check if RetailAddItemMenuItem is initialized correctly.
Also If you want to enable/disable buttons based on data in SalesLine then Active method is correct.
Hi ,
Written the code provided but same result.
Add product is editable.
NOTE- Also written the code on SalesLine form Datasource OnInitialized
André Arnaud de Cal...
292,187
Super User 2025 Season 1
Martin Dráb
230,966
Most Valuable Professional
nmaenpaa
101,156