On click of UI action autogenerate unique number
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2024 12:43 AM
Hello All,
I have a requirement that I want to autogenerate a Number for "challan" field on click of UI action. The number generated should be unique for every record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 10:14 AM
There is an API for that. Check out
gs.generateGUID()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 10:45 AM - edited 04-19-2024 10:47 AM
Hi @Sanchita02 ,
Please create Client callable UI Actions and add below code
function unique() {
var id = "Challan" + Math.random().toString(16).slice(2);
alert("id = " + id);
}
Result:
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 12:39 PM
Math.random() does not ensure the number is unique