Dynamically getting id

Dynamically getting id

  

Hi

Is there any possibility to get dynamically  form record id without submitting at the same time i has to create dynamically code.please pour your ideas.


Thanks in advance,

Shaheen.

Hi Shaheen sara,

The Id of an Entity can be automatically assigned by the database (Is AutoNumber set to Yes/True on your Identifier attribute) or manually, by you (if Is AutoNumber is set to No/False).

If you manage your Ids manually, then it is your responsibility how you create them so you could implement some mechanism of defining unique identifiers before submitting; but if they are automatically assigned, then that only happens when the record is created on the database.

Hi Shaheen sara,

If you want a unique key that will define you record(apart from primary key)before saving your request then I would suggest to add another column for dynamic generated key 'Code' (apart from the default entity Id) and you can define a function to generate the id dynamically when the form is loaded. Easy way is to add current date time format .something like '03122018132212' as code . Please see the code below.

FormatDateTime(CurrDateTime(),"ddMMyyyHHmmss")

This will be unique as I have been using this in one of my project .Hope this will be applicable in your current scenario .

Pranav, if two users submit simultaneously they get the same second... The bigger the number of users, more likely it is for a duplicate to occur.

It is safer to use GenerateGuid() from (System) or even GeneratePassword(). GUIDs are bigger and more random so that should be your choice. In Password you can set the length but is not guaranteed to be unique.

Nuno Reis wrote:

Pranav, if two users submit simultaneously they get the same second... The bigger the number of users, more likely it is for a duplicate to occur.

It is safer to use GenerateGuid() from (System) or even GeneratePassword(). GUIDs are bigger and more random so that should be your choice. In Password you can set the length but is not guaranteed to be unique.

Agreed !! We can make use of 'GUIDs' as it much efficient way .