Hello,
I'm currently trying to use the following code to update a DocumentType properties programmatically.
I get the property from the correct ContentType by alias then I update properties and call Save(). but it seems that updated value
//get property
var property = contentType.getPropertyType(propertyAlias);
// updating
property.Name = propertyName;
property.Mandatory = propAttr.Mandatory;
property.ValidationRegExp = propAttr.ValidationRegExp;
property.Description = propAttr.Description;
property.SortOrder = propertySortOrder;
property.Save();
But it seem that update is not made since when I look at the backend or in the database for this property calue is still the same.
I test the backend to be sur that everything is fine and property updates is OK from there.
Thanks per advance for your time.
David
Where in the code do you try to update a documenttype? Some events have changed so some things won't work anymore in the beforesave or aftersave event.
PropertyType.Save doesn't seems to work anymore
Hello, I'm currently trying to use the following code to update a DocumentType properties programmatically. I get the property from the correct ContentType by alias then I update properties and call Save(). but it seems that updated value //get property var property = contentType.getPropertyType(propertyAlias); // updating property.Name = propertyName; property.Mandatory = propAttr.Mandatory; property.ValidationRegExp = propAttr.ValidationRegExp; property.Description = propAttr.Description; property.SortOrder = propertySortOrder; property.Save(); But it seem that update is not made since when I look at the backend or in the database for this property calue is still the same. I test the backend to be sur that everything is fine and property updates is OK from there. Thanks per advance for your time. David
Hello,
Where in the code do you try to update a documenttype? Some events have changed so some things won't work anymore in the beforesave or aftersave event.
Jeroen
Crap formatting didn't work here is my code :-) :
I didn't save anything regarding documentType I only try to change sortOrder and some other property value.
Should I do something with the contentType reference I get.
I don't use the new ContentTypeService to do my change but the legacy API.
Hope this helps
is working on a reply...