Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Incremental Line Number field on a custom table

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

I have filed on a custom form Line number , this field should simply generate the line number as per record creation from 1 to the last record entered. As per my knowledge, i dont need to write it through sequence number , i can achieve it simply by inittvalue() method. 

Please correct me if i am wrong also please refer any blog or reference where i can take the reference. Please find the screen shot below.

Error85.PNG

when new form will create and again we will add item , it should start from 1 like ..1,2,3... 

  • Blue Wang Profile Picture
    on at
    RE: Incremental Line Number field on a custom table

    Hi Sachin,

    I am very glad to hear it.

    The link you shared is the attribute mentioned by Andre, and the link I shared with you also provides the same idea. In short, I am glad you shared your solution, I marked your answer, thank you.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Incremental Line Number field on a custom table

    Hello Andre and Blue,

    Thank you so much for your suggestion, i found a perfect blog for this requirement. this is the link (Link), this link is very useful for such requirement and contains step by steps  procedure. I have implemented it and my line number field is working fine as i was expecting.

    Error86.PNG 

    Please mark this as answered so that other people could also take advantage of it

  • Blue Wang Profile Picture
    on at
    RE: Incremental Line Number field on a custom table

    HI Sachin,

    You can take the sales line as an example, index on your line number and apply it to the data source.

    And have you tried to set allow duplicate to Yes, any errors or any feedback?

    Follow this: dynamicsaxinsight.wordpress.com/.../

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    293,001 Super User 2025 Season 1 on at
    RE: Incremental Line Number field on a custom table

    Hi Sachin,

    I have never used the form property with an integer field. When you want to insert records in between, it needs to have values with decimals. You can try if it works.

    For the index, you have to create one with at least two fields. In your scenario it would be form number, line number.

  • Community Member Profile Picture
    on at
    RE: Incremental Line Number field on a custom table , D365 F&O

    Thank you for the suggestion Andre i have two questions

    1.will it work for the field type integer , my field currently is integer type or i have to change it

    2.in index property if i will set allow duplicate value NO, it will apply on table level right  so for the next record which would be under another form number , line number will again start from 1,2, 3, and as per previous entry those line number are already there in the table. so i guess i should set property allow duplicate on index as YES.

    Please advise

  • Suggested answer
    André Arnaud de Calavon Profile Picture
    293,001 Super User 2025 Season 1 on at
    RE: Incremental Line Number field on a custom table , D365 F&O

    Hi Sachin,

    You can achieve your requirement with only property settings. Ensure you have in index with the line number. Then you can use the 'Counter field' property on the form data source to have a number generated automatically. This will work with a decimal field as line number.

    If you need integers, you can indeed write coding on e.g. the initvalue() method.

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.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,001 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,833 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans