Thanks for sharing that, good to know using a date as the unique id is practical.
When I build my solution I will see if I and fill the gaps with the uni link plugin.
Regards
Yony
Are you able to share the method you use to increment the date time. I belive milliseconds MMM can now be added to date time stamps.
Of course I will share back my solution that you may be able to use some features.
Regards
Tony
function generateUniqueId(uniqueId) {
/* Returns a unique number based on date and time */
/* If the passed value is 0 then the function generates a new unique id */
/* If the passed value is not 0 then the function checks if the value ist unique */
var notUnique= 0;
/* Generate the unique number */
if(uniqueId == 0) {
uniqueId = new Date().formatString(config.options.extendedBrainFormatUniqueId);
}
/* check if not already in use */
do {
if(checkUniqueId(uniqueId)) {
uniqueId = parseInt(uniqueId) + 1;
notUnique = 1;
} else {
//alert(uniqueId + " is unique");
notUnique = 0;
}
} while(notUnique);
return uniqueId;
};config.options.extendedBrainFormatUniqueId = "YYYY0MM0DD0hh0mm0ss";
\define createUniqueID(field: "id")<$wikify name="timestamp" text="""<$macrocall $name="now" format="YYYY0MM0DD0hh0mm0ssXXX" />""" output=text ><$set name="fieldCount" filter="[search:$field$<timestamp>count[]]" ><<timestamp>><<fieldCount>></$set></$wikify>\end