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, ...
Unanswered

When clicking on the button in the form I need to reset the field in the table

(0) ShareShare
ReportReport
Posted on by 87

When clicking on the button in the form I need to reset the field in the table 

this code in class I created 
I need to add code in while to reset field in the table

[FormControlEventHandler(formControlStr(ProdParmReportFinished, SHG_ResetGoodQty), FormControlEventType::Clicked)]
    public static void SHG_ResetGoodQty_OnClicked(FormControl sender, FormControlEventArgs e)
    {
        FormRun formRun=  sender.formRun();
        FormDataSource ProdParmReportFinished_DS = formRun.DataSource("ProdParmReportFinished");
        ProdParmReportFinished  ProdParmReportFinished = ProdParmReportFinished_DS.getFirst() as ProdParmReportFinished;

        while(ProdParmReportFinished)
        {



        }


        ProdParmReportFinished_DS.refresh();
        ProdParmReportFinished_DS.reread();        
    }

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    299,576 Super User 2025 Season 2 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    Hi pavilionit,

    Can you tell what business requirement you try to solve here? What table, what field should be reset? How do you determine the previous value or do you mean to clear a value instead of a reset?

  • pavilionit Profile Picture
    87 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    table: ProdParmReportFinished

    field: "QtyGood"

    delete the value of "QtyGood" and reset the value to 0 (zero) or

    edit value of  "QtyGood" to 0 (Zero) for all data in my form

  • Dynamics 365 Finance Profile Picture
    25 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    Hi pavilionit,

    Can you provide details on business requirement to comment on

  • pavilionit Profile Picture
    87 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    i have form in D365 finance and operation and need to update data in this form as mentioned in previous comment.

    When you click on the reset button, it will update the data and change the value of a specific column to zero

  • pavilionit Profile Picture
    87 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    i have form in D365 finance and operation and need to update data in this form as mentioned in previous comment.

    When you click on the reset button, it will update the data and change the value of a specific column to zero

  • Alex VN Profile Picture
    1,994 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    Hi,

    With your requirement you might use:

           while(ProdParmReportFinished)

           {

           ProdParmReportFinished.QtyGood = 0;

           ProdParmReportFinished = ProdParmReportFinished_DS.getNext() as ProdParmReportFinished;

           }

    This will help you to loop through all the ProdParmReportFinished records in ProdParmReportFinished_DS and update QtyGood to 0.

    Hope it helps.

    Regards,

    Anh Ong

  • pavilionit Profile Picture
    87 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    When I press the button, it does nothing except when I click on a value in the form, it deletes the data except for the first value, and this is wrong.

    Because I do not have to click on its value in order to delete the data

  • pavilionit Profile Picture
    87 on at
    RE: When clicking on the button in the form I need to reset the field in the table

    1) 146170.png

    2)2106247.png

    3)Screenshot-_2800_126_2900_.png

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier 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,922

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 1,922

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans