Notifications
Announcements
No record found.
I want to add line number(in row as 1,2,3...) in my simple list form D365Fo What is complete procedure to do it?
Hi JJDunaid,
Refer to the standard TsTimesheetLine table for adding line numbers to the row.
You need to add a code to set the next line number and also it must be added to the index.
Refer to the method setNextLineNum method on TsTimesheetLine table which is called in the initValue of the table method.
Thanks,
Girish S.
i want to add line number in a grid of form,
whenever i add new line into grid i want it to add it self by 1, e.g (like line number 1,2,3 and so on.....)
would be easier if you send me code to write in initvalue().
Yes, I understood the issue. You need to create an integer field in the table.
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; }
If it is a form that will be used by more than one person or the registration time is long, init may not be the right place (someone else can get the same number until you save it) I think you should write it in the insert
Ergun Sahin,
yes it is doing the same as you just told!
but its just showing me 2 insert methods (insertifempty(), insertatend())
which one should i choose and do i have to write same code as i did in initvalue() method?
yes it did work but when i add new record it adds new record in same row and adds lineNumber in same row
,now its not even adding any new record
InsertIfEnd and InsertIfEmpty is the property on the DataSource.
You need to override the insert method on the table and add the code as you have written on the initValue method.
What do you mean by "it adds new record in same row and adds lineNumber in same row"?
If you click on New button on the form, it will create new record in the table - It will not override the existing line.
Girish
thanks for your help :)
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 584 Most Valuable Professional
André Arnaud de Cal... 499 Super User 2025 Season 2
Sohaib Cheema 254 User Group Leader