cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate a random ID without using Rules in Agentry?

Former Member
0 Kudos

Hi Experts,

My requirement is to add a new employee/student, so whenever i click on Add button a unique id should be generated. How can i achieve this functionality in Agentry? I know how to generate unique IDs using Rules but i want to know is there any other way also to generate it. Your valuable suggestions will be highly appreciated.

Thanks and Regards,

Mohammed Liyaqath Hussain

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Mohammed,

without using rules it is not possible to generate UniqueID in Agentry (Probable you can use OpenUI control). You have to write a rule and the rule will be "Rule Before Data Entry" and in that rule you can simply pass TIMETICKS which will be unique all the time. Real unique id will be generate in Backend.

Hope this helps you

Thanks

Ajitesh

Former Member
0 Kudos

Ajitesh,

Thanks for the reply.

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Mohammed,

Typically in Agentry, we generate locally unique ids for newly added objects (employee/student) when they are created on the device.  These local ids are temporarily used to allow for multiple adds before the transaction is posted to the backend and the real unique id is created by the backend.  This allows us to avoid potential collisions with existing records in the backend or newly added items from another device.  As part of the transaction processing the ID on device is then updated with the real id from the backend system.

As an alternative, I suppose you could create an open UI control to generate a random number instead but you will need add additional logic on your transaction processing steps to handle potential collisions.

Is there a reason you don't want to use a rule?

--Bill

Former Member
0 Kudos

Bill,

Thanks for the response. There is no particular reason that i don't want to use a rule. I was just  looking for the possibilities to achieve the requirement.

Thanks & Regards

Mohammed Liyaqath Hussain

mark_pe
Active Contributor
0 Kudos

Bill and Ajitesh,

Thanks for the assistance.

Best Regards,

SAP Mobile Support Team