The trouble is you think you have time. Your success depends on how you utilize your time.

Update or Refresh Form using X++ in Events or in Class Dynamics Finance and Operations

Update or Refresh Form using X++ in Events or in Class Dynamics Finance and Operations

To update or refresh a form while using a main(Args _args) function of a class you need to get the caller as FormRun object. 

            FormRun formRun = _args.caller();
     if(formRun)
     {
        #Task
        formRun.task(#taskRefresh);
     }

let say you want to use this code in an event then you will use it like this:

      [FormControlEventHandler(formControlStr(SalesTable, ImportFromExcel), FormControlEventType::Clicked)]
        public static void ImportFromExcel_OnClicked(FormControl sender, FormControlEventArgs e)
        {
            FormRun formRun = sender.formRun();
            if(formRun)
            {
                #Task
                formRun.task(#taskRefresh);
            }
        }

Want to read more cool stuff about Finance and Operation and Dynamics AX development then click HERE

No comments:

Post a Comment