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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

How to enable/disable "Remove" button depends on selection different sales line under sales table form?

(0) ShareShare
ReportReport
Posted on by 962

Hi All

          How can I enable/disable "Remove" button when select different sales line under sales table form?

          For example, In a SO, it has many sales order lines. Some sales order lines are invoiced. When we select the invoiced sales lines, the "Remove" will be Disable. else the "Remove" is Enable.

pastedimage1580252852224v1.png

           Where should I add code to achieve this function?

Best Regards,

JustZM

I have the same question (0)
  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Use COC on active method of salesline datasource and enable/disable button based on your condition.

  • JustZM Profile Picture
    962 on at

    Hi Sukrut

              Thank you for your reply. However, when I used COC for active under DataSource, it shows me some errors.

              Do you know how can I fix this issue?

    Best Regards,

    JustZM

    pastedimage1580337801325v1.png

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Just remove defaulting  from the parameter (= false) and then try.

  • JustZM Profile Picture
    962 on at

    Hi Sukrut

              The same errors are still there.

    Best Regards,

    JustZM

    pastedimage1580340488251v1.png

  • Suggested answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    Method return type is Boolean and you declared it  as integer. Correct it change type of ret variable to Boolean  and then try.

  • JustZM Profile Picture
    962 on at

    HI Sukrut

            I follow your suggestion to change int to Bollean, but the errors are same.

           pastedimage1580342137840v2.png

           And I re-check the active in DataSource SalesLine, it is Int.

          pastedimage1580342017060v1.png

    Best Regards,

    JustZM

  • Verified answer
    Sukrut Parab Profile Picture
    71,710 Moderator on at

    You are correct about the return type , make it integer and   remove parameter from the active method, that should work. Its weird that compiler is complaining about default parameter.

    [ExtensionOf(formdatasourcestr(SalesTable,SalesLine))]

    final class MySalesLine_extension

    {

       int active()

       {

           int     ret;

           ret = next active();

           return ret;

       }

    }

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans