AutoNumber field in CDS | PowerApps

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]
    createNew

  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.
    2TypesOfAutonumber

    String Prefixed number

    You’ll need to define the Prefix, Min Digits, Seed value
    preview

    Date prefixed number

    With Date prefixed, you’ll need to define Date Format, Min Digits of Seed Value
    dateFieldPreview

    Custom

    With 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!

Create new Sandbox and copy Production over to it in PowerPlatform Admin Center

This is one of the standard approaches if you want to copy over a Production instance over to a Sandbox one. Most common scenarios being when you’ve on-boarded a new client to Dynamics 365 / PowerPlatform and you’re nearing Go Live for the first time!

You need a Sandbox to then follow new customization on the Sandbox and avoid doing anything on the Production. Here’s how you copy over from Production to Sandbox!

 

Creating a Sandbox

  1. Create a new Environment by clicking on the +New button as below
    newButton.png
  2. Now, you can directly create a new Sandbox environment in the PowerPlatform Admin Center (https://admin.powerplatform.microsoft.com/environments)
    Remember: Both the source and target environments need to be in the same region to copy.
    createSandbox.png
  3. Additionally, I’ve selected the Create a Database option too since I want to speed up the process.
    addingDatabase.png
    Note that you can chose which all apps you want to deploy if you chose Enable Dynamics 365 apps

And that’s it. You’ll need to wait for some time until this is processed!

If you’re also looking to create a Database explicitly for an existing environment using a previous method, you can check this post – Create new CDS Environment and Database quickly from PowerApps Admin Center

While this happens in the background, you can see the message on the Environments section on the Power Platform Admin Center
preparing.png

 

And upon completion, you’ll see the below message
completedCreation.png

Copying From Production to Sandbox

Next step is to copy over the Production to the newly created Sandbox environment.

  1. Select the Production environment you want to copy over and look at the ribbon, you’ll see a copy button.
    copyButton.png
  2. Once you click on the Copy, you’ll be asked about the target environment, chose the created Sandbox.
    selectTarget.png
  3. Once you confirm, the copying process will start. And you’ll be taken to this page which tells you what stage the process is in –
    currentProcess.png
  4. Once all the copying is completed, this notification will appear. Now, the next step is to turn off Administration Mode. Click on settings link as shown below by arrow.
    copySuccess.png
  5. Once you flick the switch and Save, Administration Mode will be disabled letting others to log in as well. Additionally, now we have the option to keep Background Operations On as well while keeping Administration Mode On as well.
    disableAdminMode.png

Now, you are all set. Hope this helps!