web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How un editable "Add lines" button in SalesLine

(0) ShareShare
ReportReport
Posted on by 113

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 .

I have the same question (0)
  • HARISH MEHRA Profile Picture
    113 on at
    RE: How un editable "Add lines" button in SalesLine

    Hi Mohit,

    Yes this worked for me.

    Thanks Mohit & Girish

  • Suggested answer
    Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    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)
        }
    }

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    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.

  • HARISH MEHRA Profile Picture
    113 on at
    RE: How un editable "Add lines" button in SalesLine

    Hi ,

    I think here it is enabling.

  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    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.

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    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.

  • HARISH MEHRA Profile Picture
    113 on at
    RE: How un editable "Add lines" button in SalesLine

    Yes,

    I debugged the code it is showing enable false for both buttons.

  • GirishS Profile Picture
    27,825 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    Have you debugged the code.?

    See what is the value of salesLine buffer/

    Thanks,

    Girish S.

  • Mohit Rampal Profile Picture
    12,563 Moderator on at
    RE: How un editable "Add lines" button in SalesLine

    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.

  • HARISH MEHRA Profile Picture
    113 on at
    RE: How un editable "Add lines" button in SalesLine

    Hi ,

    Written the code provided but same result.

    Add product is editable.

    NOTE- Also written the code  on SalesLine form Datasource OnInitialized

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,132

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 778 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 739 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans