09 April 2021

Looping selected records in the form in D365FO and X++ code to loop form selected records.


When the class main method initiated there can pass the args.record to below method and can loop records.

Reference: Class: PurchReqCancel

private void runLoopCancelWin(Common _common)
    {
        FormDataSource fds            = FormDataUtil::getFormDataSource(_common);
        Common         common;

        for (common = fds.getFirst(1) ? fds.getFirst(1) : fds.cursor(); common; common = fds.getNext())
        {
            this.doCancel(common);
        }
    }








No comments:

Post a Comment

Give me the commetns and solutions

How to add the Display method in the form level in D365 F&O

 The below examle is to add the form -Data source level adding display method and assigning to form design control.