public FreeText getDecendants(ItemId _itemid)
{
str Decendants;
EcoResProductCategory ecoResProductCategory;
EcoResCategory ecoResCategory;
EcoResCategory ecoResCategoryAscendants;
select firstOnly ecoResProductCategory
where
ecoResProductCategory.Product==EcoResProduct::findByProductNumber(_itemid).RecId;
select firstOnly ecoResCategory where ecoResCategory.RecId==ecoResProductCategory.Category;
Decendants = ecoResCategory.Name;
while select * from ecoResCategoryAscendants
order by ecoResCategoryAscendants.NestedSetRight
where ecoResCategoryAscendants.CategoryHierarchy == EcoResCategory.CategoryHierarchy
&& ecoResCategoryAscendants.NestedSetLeft < EcoResCategory.NestedSetLeft
&& ecoResCategoryAscendants.NestedSetRight > EcoResCategory.NestedSetRight
{
Decendants = strFmt("%1-%2",ecoResCategoryAscendants.Name,Decendants);
}
return Decendants;
}
Like this:
Like Loading...
Related