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 :
Microsoft Dynamics AX (Archived)

Uncheck other checkbox if check one check box

(0) ShareShare
ReportReport
Posted on by 1,845

hi all

i have form in that form one checkbox fields is there user should check any checkbox  and get popup with yes no option if user click on yes that checkbox is checked and other checkbox unchecked. that means only one checkbox is check how to achieve this.

any suggestion is very helpful2045.Capture.PNG.

Thank You.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nasheet Siddiqui Profile Picture
    440 on at

    My Recommendation is that activation of the record should by button.

    Follow the below steps to achieve the functionality.

    1. Make Active field allowEditOnCreate = false, allowEdit=false on the table level.
    2. Create button with text Active.
    3. Create recordActivated method on the table. In this method update existing active to inactive and update current record to active.
    4. Call this method on the clicked method method of Active. Call research method of the data source after that so that form re-read and refresh the form.
  • Anoop Tripathi Profile Picture
    790 on at

    Are you using grid control ?

    Is it necessary to have have a pop up box as well confirming if the user wants to check the check box.

    if this is a grid then you will need to override the modified method.

  • startax Profile Picture
    1,845 on at

    hi anoop ,

    Yes i am using Grid and yes no box is also mandatory,

    can you provide me some more details

  • Suggested answer
    Anoop Tripathi Profile Picture
    790 on at

    in that case

    Just in the override modified method of the yes/no field in the datasource and add below code.

    Do replace the info message boxes with your own relevant code.

    public void modified()

    {

       DialogButton    diagBut;

       str 50 varYes;

       super();

       varYes = "Are you sure?";

       diagBut = Box::yesNo(varYes,DialogButton::No);

       if(diagBut)

           info("yes Clicked");

           else

               info("no clicked");

      TestProj_ds.reread();

      TestProj_ds.refresh();

    }

  • startax Profile Picture
    1,845 on at

    hi anoop,

    i am tried above approach but cant handle checked unchecked . that means user cant check multiple checkbox . i need only one checkbox checked.

  • startax Profile Picture
    1,845 on at

    hi nasheet,

    i am written record activated method on table after that override validate method of that field in design (EX. custtable form contactinfo , logisticsElectronics address)

    it is working fine when i check any checkbox but its not unchecked other checkbox.

    i need only one checkbox checked other unchecked.

    here is my code for record activated method on table

    public boolean otherActiveExists()

    {

       Table table;

       select firstonly RecId from table

           where table.id== this.id &&

                      table.name == this.name &&

                     table._Active == true &&

                   table.RecId != this.RecId;

       return table.RecId != 0;

    }

    this is correct or not??

  • Anoop Tripathi Profile Picture
    790 on at

    you can just add code block for that where I have written "Yes clicked" line.

    just add a line:

    select firstonly RecId from yourTable where yourTable.yesnoField == true;

    if record is found then show and error message and abort your update operation.

    This quite straight forward I don't understand where are you getting confused.

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans