SetTable ( newMyTable : Record "My Table") MyTable := newMyTable; //MyTable being a global Record variable of subtype "My Table"Then you would set up value (value1, value2, etc.) for the fields that you want to modify on the Report Request Page. Users will be able to write them in (don't forget to add TableRelation if needed!) and assign them to the MyTable records in the OnPostReport() trigger:
OnPostReport() IF MyTable.FINDSET THEN BEGIN REPEAT MyTable.VALIDATE("Field Name 1", value1); MyTable.VALIDATE("Field Name 2", value2); MyTable.MODIFY(TRUE); UNTIL MyTable.NEXT = 0; END;
<Action01> - OnAction() CurrPage.SETSELECTIONFILTER(MyTable); MyReport.SetTable(MyTable); //MyReport is a local variable of type Report and subtype "My Report" MyReport.RUNMODAL;
Answers
Please note that this will NOT validate the fields! In order to validate them (run code on their OnValidate triggers), you need to loop through the records, so your code becomes something like this:
Is it wise? depends what fields you want the user to change like that. (if a user is distracted and makes a typo or selects too many records)
You would need to create a function inside the report to retrieve the selected records, something like Then you would set up value (value1, value2, etc.) for the fields that you want to modify on the Report Request Page. Users will be able to write them in (don't forget to add TableRelation if needed!) and assign them to the MyTable records in the OnPostReport() trigger:
And then, of course, change the Page Action code to call the Report's SetTable function first and then the report itself:
Alternatively, on your processing report you could set up "My Table" as DataItem, and then instead of the function SetTable, use SETTABLEVIEW before calling the report to set the record. And then you would write the modification code not in OnPostReport, but under "My Table - OnAfterGetRecord()".