Fetching Unique ID and substring it to the 6 figures.
I was looking around for an answer to this problem and couldn't really find the solution that fits but managed to create a code that fetches the Unique ID out of the record URL and substring it to the last 6 unique figures.
Each Unique ID has 19 figures and the first 13 ones represent the module and the last 6 are unique ones record-related. In our use case, we needed a simple number (no longer than 6 figures) that is unique for each record so used this code and workflow in order to achieve this:
mp = Map();
sixfigID = dealID.subString(13,19);
mp.put("Deal_Record_ID",sixfigID.toText());
updatedRec = zoho.crm.updateRecord("Deals",dealID,mp);
info updatedRec;
info sixfigID;
Edit Argument: dealID = Deals > Deal ID
Then a workflow is created triggered upon creation or in case you need to update old records on Create/Edit and add a field that you can change in order to trigger the workflow. For Example "Fetch ID" checkbox which you can remove once you finish.
Hope this will help someone!