Execute task command

During the last weeks i had to create a new form with multiple datasources. In the first moment it sounds simple. Up to this point it is too. But some new functionalities later i wanted to refresh the forms datasources. The common approach is to do a research/refresh/reread on the datasources. But that was not the solution. Some records didn’t refresh. Pressing F5 did the wished refresh but i don’t wan’t the user to hit the F5 button after some clicks.

After some ‘googling’ and trying i found a simple solution, which you can hopefully use in the future: The task-command.

The task-command is available for a formRun you have selected in the code.

#task
element.task(#taskF5);

// Same thing like
element.task(4823);

The F5 task is an example what you can do with the method. You can also insert the task id as method parameter. You can find all ids in the command property if a command button. These are doing the same functions.

One thing you have to remember: The task will only hit the forms main datasource if you enter a command for a record. You can’t specify which datasource the task should process.

Leave a Comment