Form task() method is executed, when the user performs some task in a form e.g. using the toolbar, the menu, or the keyboard.
For example, if the user has activated the grid filter after opening the form, its called with task() with 2855 as parameter. Like this we can automate any user actions in toolbar, menu or keyboard by knowing the taskId for each action. That can be found by adding a break point in task(). By adding the following code in form run() after super will enable grid filter automatically.
public void run()
{
super();
this.task(2855);
}
Need to call this.task(2855); at canClose() so that the grid filter is released, and will reapply on form run (need to explore a bit how to handle the same effect by reading sysLastValue table).
But by default its needed in all the form, it can be set globally in Tools > Options > Details > Filter by grid on by default check box enabled.
Somasegar's blog - Site Home - MSDN Blogs
10 years ago