Anyone out there who can help on this? I understand that this has been replaced by the RelationService, however the documentaton on this doesn't have many examples and I don't see a function to get the relations by Model.Id and RelationType.
This change is stopping my language picker from working, please can someone help!
RelationService problem
Hi there
I've finally migrated from 6.0.5 to 7.0.3 and all works so far except my Relations.
The following MarcoScript code I use and cannot get it to work in Umbraco 7:
RelationType relationType = RelationType.GetByAlias("relateDocumentOnCopy");
Relation[] relations = Relation.GetRelations(Model.Id, relationType);
foreach(Relation relation in relations)
{
int relationId = relation.Parent.Id;
if(relationId == Model.Id)
{
relationId = relation.Child.Id;
}
var TopLangPage = Model.NodeById(relationId).AncestorOrSelf(1);
if(curLanguage == TopLangPage.Language)
{
curUrl = Model.NodeById(relationId).Url;
}
}
Any help would be much appreciated.
Hi there
Anyone out there who can help on this? I understand that this has been replaced by the RelationService, however the documentaton on this doesn't have many examples and I don't see a function to get the relations by Model.Id and RelationType.
This change is stopping my language picker from working, please can someone help!
Kind regards
Jonathan
Have the doubt that something with the relations is wrong in v7.
Tryied to migrate a package from v6 to v7 and also the relations are not working.
I'm using the new RelationsService in my case.
is working on a reply...