Saturday, April 23, 2016

X++ code for Mark all Records using Checkbox in ax 2012



First Create CheckBox field and select property AutoDeclaration as Yes Overide Clicked method

 public void clicked()
{
    SK_CustomerAddress SK_CustomerAddress1;

    super();

    ttsBegin;
    while select forUpdate IsPrimary from SK_CustomerAddress1
    {
        if(Mark.value()==1)
        {
            SK_CustomerAddress1.IsPrimary = Noyes::Yes;
        }
        else
        {
            SK_CustomerAddress1.IsPrimary=Noyes::No;

        }
        SK_CustomerAddress1.doUpdate();
    info(strFmt("%1",SK_CustomerAddress1.IsPrimary));

    }
    ttsCommit;

    SK_CustomerAddress_ds.executeQuery();
    //SK_CustomerAddress_ds.refresh();
    //SK_CustomerAddress_ds.research();
}

No comments:

Post a Comment

Export a copy of the standard user acceptance testing (UAT) database

 Reference link: Export a copy of the standard user acceptance testing (UAT) database - Finance & Operations | Dynamics 365 | Microsoft ...