I have worked with my self programmed CMS but new on Umbraco. I am working on Umbraco 4.7 with .net framework 4 and want to create a content structure somewhat like this
MaleModels
|--------------Model (Can be multiple)
|----------- Model Id (Problem)
|----------- Name
|----------- DOB
|----------- etc...
I need to create node for each Model and want to assign a unique Model Id to each model but can’t find any data type that can be used for Auto Increment field (As I do when programming custom .net code with SQL). I know that I can use @pageId, but I want Model Id to start from 100 and with single increment for each Model only.
Need Help…
One option is that you could handle the Document.AfterPublish event in a custom library that could add the auto increment value to a “autoID” field after creation and save/publish it again. You may need to keep a counter of the current increment id value (say in the “MaleModels” node above) so you don’t have to query all of the Models each time to find the highest ID.
Here’s a blog post about events in Umbraco that may help with the details: http://www.bo-mortensen.dk/2011/10/umbraco-more-event-goodness/