Your ContentItem has been created???

Topics: Writing modules
Feb 5, 2013 at 6:52 PM
I have created a creatable Custom ContentType with a Custom ContentPart that has an int column named WeekOfId. When creating a new instance WeekOfId defaults to 0. I cannot allow a 0 value in this column.

I painted this column with {Required, Range(1,999999) and this throws a non fatal exception which allows the type to be saved, so I check the WeekOfId value in the drive POST editor like this

if (part.WeekOfId > 0) {
updater.TryUpdateModel(part, Prefix, null, null)
return Editor(part, shapeHelper);

This prevents the type from being saved, but the message "Type has been created" is displayed in the dashboard.

My question is how do I display a message telling the user the type has not been saved and they need to make the WeekOfId greater then 0?