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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

How to pass checkbox value from form method to class method

(0) ShareShare
ReportReport
Posted on by

hi all,

I have passed a checkbox value in form -button clicked method as below: 

classname::getMethod(UnapprovedReq.checked(true)));

UnapprovedReq is my checkbox name in form design.

In class method, I have declared as

public static getMethod(Noyes _noYes)

i'm getting error as "Parameter _noYes must have a default value"

anybody please help me how can I retrieve the checkbox value on class which is passed from Form Button click method.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mea_ Profile Picture
    60,286 on at

    Hi Lakshmi.ch,

    I have not seen this error before, can you explain what exactly are you doing ?

    I'm not quite sure why do you have static method. I think you need to declare a variable in classDeclaration method of your class:

    public class MyClass
    {
        boolean isChecked;
    }

    Then you need to create parm method

    public boolean parmIsChecked(boolean _isChecked = isChecked)
    {
        isChecked = _isChecked;
        return isChecked;
    }

    and then in a button click instantiate new intance of the class and pass value of checkbox to the parm method:

    void clicked()
    {
        MyClass myClass = new MyClass();  //instantiate
    
        super();
    
        myClass.parmIsChecked(UnapprovedReq.checked()); //pass value
    myClass.run() //do something }

    You don't need to pass "true" to UnapprovedReq.checked() because it will set a value of checkbox.

  • Community Member Profile Picture
    on at

    Hi,

    The class method to which I'm passing the value from form, has many other parameters like datevalue, containers and my checkbox value. So Public static has been used. And Class.run() is called in this method only.

    hence I'm not able to call run() from the form.

    so I wanted to know how to retrieve this checkbox value in class method.

    I tried with Boolean but it didn't work.

  • Mea_ Profile Picture
    60,286 on at

    What exactly did you try ? Probably it's a good idea to share your code because it's hard to understand what is wrong without it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#1
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#1
Pratik Bhosle Profile Picture

Pratik Bhosle 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans