static void categoryherirachy_Deleted(Args _args)
{
inventtable _invent;
EcoResProductCategory _ecoresproductacte;
RetailSpecialCategoryMember categoryMember;
while select * from _invent where _invent.ItemId like "ASTW*" //mention the items
{
// info(strFmt("done %1",_invent.Product));
select forUpdate * from _ecoresproductacte where _ecoresproductacte.Product == _invent.Product;
if(_ecoresproductacte)
{
if (isConfigurationkeyEnabled(configurationKeyNum(Retail)))
{
// if special group
if (EcoResCategoryHierarchyRole::existRoleHierarchyPair(
EcoResCategoryNamedHierarchyRole::RetailSpecialGroup,
_ecoresproductacte.CategoryHierarchy))
{
categoryMember = RetailSpecialCategoryMember::findByMemberLine(
_ecoresproductacte.Category,
0,
_ecoresproductacte.Product,
0,
true);
if (categoryMember)
{
// this will cascade to the member line.
categoryMember.delete();
}
}
}
ttsBegin;
_ecoresproductacte.delete();
ttsCommit;
info(strFmt("category deleted for item %1",_invent.ItemId));
}
}
}
No comments:
Post a Comment