Blog

Latest from the Blog

How to Create Auto Generate Number in Power Apps and Dynamics 365 Using OOB Auto Number Field.

Previously we dint have option to use a field type called AutoNumber in older versions of Microsoft Dynamics CRM at that time we are writing Jscript code but luckily Microsoft introduced Auto Number data type recently, which automatically updates the data in the field to a set format and increments a number in the field. Let’s look at how to do this this Account Entity.

Step 1: Login with system admin credentials to PowerApps at https://make.powerapps.com/environments and select your PowerApps environment.

Step 2: Click on Data –>Entities and select the Account entity  to see the List of fields, Relationships, Business Rules etc.

Step 3:Select Fields and Click on + Add field.

Notes:

  1. Auto Number Format Options: These examples show how you can configure the AutoNumberFormat property to get different results:
AutoNumberFormat valueExample value
CAR-{SEQNUM:3}-{RANDSTRING:6}CAR-123-AB7LSF
CNR-{RANDSTRING:4}-{SEQNUM:4}CNR-WXYZ-1000
{SEQNUM:6}-#-{RANDSTRING:3}123456-#-R3V
KA-{SEQNUM:4}KA-0001
{SEQNUM:10}1234567890
QUO-{SEQNUM:3}#{RANDSTRING:3}#{RANDSTRING:5}QUO-123#ABC#PQ2ST
QUO-{SEQNUM:7}{RANDSTRING:5}QUO-0001000P9G3R
CAS-{SEQNUM:6}-{RANDSTRING:6}-{DATETIMEUTC:yyyyMMddhhmmss}CAS-002000-S1P0H0-20170913091544
CAS-{SEQNUM:6}-{DATETIMEUTC:yyyyMMddhh}-{RANDSTRING:6}CAS-002002-2017091309-HTZOUR
CAS-{SEQNUM:6}-{DATETIMEUTC:yyyyMM}-{RANDSTRING:6}-{DATETIMEUTC:hhmmss}CAS-002000-201709-Z8M2Z6-110901

2) For Sequential value place holders {SEQNUM:3}, minimum length is 1, if you set the value to be 2, the initial value will be 01 and the 100th entity value will be 100,

The Number will continue to increment beyond the minimum length.

Maximum length can be set between 1 to 4000 digits/Characters.

Assuming Max length is set to 10

for Example : As per Reg Expression {SEQNUM:3}format

Start Value : 001

End Value -999999

3) There are 3 types of Auto Number Types (String Prefixed number, Date Prefixed number and Custom)

For more details https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes link refereed from Microsoft docs.

Step 4: Enter Display Name and Choose Data type as Autonumber and Select Autonumber type, enter Format , seed value as per your requirement and Click on Done.

Step 5: In the bottom right click on Save Entity. (Entity will be saved and published)

Step 6: The field has been created now add this in form.

Step 7: Go to Forms and select the Account required form , Drag the field onto the form and In the top right, Save and Publish

Step 8: Navigate to Account and Click on + New

Step 9 : Enter the Mandatory fields and save the record.

Step 10: Auto number will be created automatically.

Please take a min to improve us and help your better. Thanks for reading.

Get new content delivered directly to your inbox.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: