Monday, February 14, 2022

Set Cursor on First field while creating the new Record in D365FO

Hi guys, Today we see how to set the cursor on the first field while creating the new record in D365FO using x++.

In my form, I have 2 data sources when I am trying to create a new record in form It automatically selects 1st form data source field. But as per my requirement, I have added the 2nd form data source field at first.
For achieving this we have 2 ways.

Way 1:
        Go to from data source field properties. we need to set skip property to yes. 
Path:
\Form\Myfrom\Data Sources\my datasouce\Fields\myfield
        


Way 2:
We can write in an active method from the data source.
first, we need set AutoDeclaration property is set to yes. (Selected field)

 public int active() {     int ret;     ret = super();     FormControlName.setFocus(); 

        return ret;

} 

Keep Daxing!!

No comments:

Post a Comment