I have created one for a page title its same principle, when you publish a page it will check all other published pages to ensure that the page title for the current page is unique.
I am going to release it at some point when i get 5 minutes
We often have a requirement to utilise a completely unique ID on a document type.
Thinking of the most recent example, we want to generate a unique ID to syndicate content to a remote source.
We chose to achieve this by creating a label (read only) data type on the document and then using a dcoument event handler to generate a GUID on the first save of the document.
The unique ID is in the format below and is guaranteed unique to some silly order by Microsoft :) 500ca0e7-5fea-433b-b3a1-527a315cb1c1
The document event handler is a file that stis in the app_code directory, here's a quick example of how we achieve this:
Unique ID Data Type
Is that possible to create a unique id data type in Document Type field ?
For example I want to define a list type of a products.
Thanks
Kurniawan,
I have created one for a page title its same principle, when you publish a page it will check all other published pages to ensure that the page title for the current page is unique.
I am going to release it at some point when i get 5 minutes
Regards
Ismail
Is umbraco has a GUID data type like in .NET?
Can we generate incremental ID (int) in umbraco?
Thanks
We often have a requirement to utilise a completely unique ID on a document type.
Thinking of the most recent example, we want to generate a unique ID to syndicate content to a remote source.
We chose to achieve this by creating a label (read only) data type on the document and then using a dcoument event handler to generate a GUID on the first save of the document.
The unique ID is in the format below and is guaranteed unique to some silly order by Microsoft :)
500ca0e7-5fea-433b-b3a1-527a315cb1c1
The document event handler is a file that stis in the app_code directory, here's a quick example of how we achieve this:
if (sender.ContentType.Alias == "mkNewsItem")
{
string stGuid = sender.getProperty("mkNewsGUID").Value.ToString();
if ( String.IsNullOrEmpty(stGuid) ){
sender.getProperty("mkNewsGUID").Value = System.Guid.NewGuid().ToString();
Log.Add(LogTypes.Save, sender.Id, "Generated GUID for news item");
}
}
Hope this helps - if you need more info - get in touch :)
Good Luck,
David :)
is working on a reply...