v6 API - IContentService.SaveAndPublish and "Picker Relations"
I am trying to maintain relations using a multi node tree picker, picker relations and a uComponents: Relation Links.
When I use the backoffice to change the values stored by the multi node tree picker using the v6 API, the relations are added and removed as expected but when I use the v6 API, in particular, item.SetValue("MNTPProperty", {1,2,3,4}), the list of relations is not affected when I do a Save and Publish.
I can create the relations using the backoffice. A comment is created which looks like the following: ["PropertyTypeId":133].
When I use the v6 API, to be able to set up the relations so that I can edit them using the backoffice, I have to set the comment in the backend so that it will match the comment generated by the backoffice. If I don't do this, the relation will not be affected by changes made in the backoffice.
var instanceIdentifier = "[\"PropertyTypeId\":133]";
// For each PickerRelations datatype
//foreach (Property pickerRelationsProperty in from property in newSite.PropertyTypes
// where property. == pickerRelationsId
// select property)
//{
// // used to identify this datatype instance - relations created are marked with this in the comment field
// instanceIdentifier = "[\"PropertyTypeId\":" + pickerRelationsProperty.PropertyType.Id.ToString() + "]";
//}
var relationType = rs.GetRelationTypeByAlias(RelationTypes.MemberWebsite.ToString());
var relation = new Relation(newSite.Id, owner.Id, relationType);
//umbraco.cms.businesslogic.relation.Relation.MakeNew()
relation.Comment = instanceIdentifier;
rs.Save(relation);
v6 API - IContentService.SaveAndPublish and "Picker Relations"
I am trying to maintain relations using a multi node tree picker, picker relations and a uComponents: Relation Links.
When I use the backoffice to change the values stored by the multi node tree picker using the v6 API, the relations are added and removed as expected but when I use the v6 API, in particular, item.SetValue("MNTPProperty", {1,2,3,4}), the list of relations is not affected when I do a Save and Publish.
How do I get the picker relations to fire?
I can create the relations using the backoffice. A comment is created which looks like the following: ["PropertyTypeId":133].
When I use the v6 API, to be able to set up the relations so that I can edit them using the backoffice, I have to set the comment in the backend so that it will match the comment generated by the backoffice. If I don't do this, the relation will not be affected by changes made in the backoffice.
How can I generate the instanceIdentifier?
is working on a reply...