Line number autoincremented in form in d365 fo x++

 Override the initValue method of the table and add the below code to increment value of LineNum field whenever new record is created.

public void initValue()
{
    YourTableName tableName;
    super();
    select firstonly maxof(LineNum) from tableName;
    this.LineNum = tableName.LineNum +  1;
    
}

Comments

Popular posts from this blog

Get Current Worker data in d365 fo x++

Table Level Event Handler in d365 fo x++