AutoNumber field in CDS | CloudFronts

AutoNumber field in CDS

Posted On April 6, 2020 by Priyesh Wagh Posted in

The most desired feature is ability to create/customize your own auto-number field. ANd CDS let’s your do just that!

I remember the good old days when I had to write a plugin to function for AutoNumber which used to configuration from a supposedly separate Configuration entity and it scary to maintain the code and entity. But this solves all that with so much ease!
allRecords

Create an AutoNumber field in CDS

  1. Now, you can start by creating a field in CDS’ Solutions > [YourSolution]> [YourEntity]
     
  2. Then, under Accounts, you can see that you can actually create an Autonumber. This is not available in Classic UI.
    Also, please note that you’ll need to keep this field Not Required and Locked (on the form) in order to function.
    underTextGroup
  3. Give it  a suitable name and then you have 3 options to format your auto-number field.
    2TypesOfAutonumberString Prefixed numberYou’ll need to define the Prefix, Min Digits, Seed value
    preview Date prefixed numberWith Date prefixed, you’ll need to define Date Format, Min Digits of Seed Value
    dateFieldPreviewCustomWith custom, you can define the Format. Refer Microsoft’s Documentation for the same – AutoNumberFormat options
    customPreview

Save and Publish as you usually would and place your field on the form you want.

Working

I used String method to design my AutoNumber field. Let’s see how it looks –
Once I save the record, the Auto-number will be filled in.
fieldWorking

If you happen to delete any records already created in the sequence, the auto-number functionality will continue counting upward and not fill out previous backlogs/last deleted auto-number records.

Hope this helps!


Share Story :

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close