21 November 2021

ED365FO event handler to get current database record

   public static void TRGvalidateHours(FormControl sender, int controlName)

    {

        FormRealControl  control = sender as FormRealControl;

        FormRun     formRun = sender.formRun();

        FormStringControl projIdControl = formRun.design().controlName(formControlStr(TSTimesheetEntry,ProjId));

        

        FormDataSource TSTimeSheetLineWeek_ds  = formRun.dataSource(formDataSourceStr(TSTimesheetEntry,TSTimesheetLineWeek)) as FormDataSource;

        TSTimesheetLineWeek timesheetLineWeek = TSTimeSheetLineWeek_ds.cursor();

        TSTimesheetTable    timeSheetTable = TSTimesheetTable::find(timesheetLineWeek.TimesheetNbr);

        ProjTable           projTable = ProjTable::find(projIdControl.text());

}

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.