Sunday, July 3, 2016

Catgeory Based on product Number ax 2012

//Catgeory Based on product Number
private str category(ItemId itemId)
{
    InventTable inventtable;
  //  EcoResCategory  category;
    EcoResProductCategory prodCategory;
    RecId catRecid;
    str 100 categoryStr;

    str recursiveCall(RecId _recid)
    {
       while select category where category.RecId == _recid//prodCategory.Category
        {
            categoryStr = '-'+category.code+categoryStr;
        recursiveCall(category.ParentCategory);
        }
        return categoryStr;
    }
    ;
    inventtable = InventTable::find(itemId);
    select prodCategory where prodCategory.Product == inventtable.Product;
    return strDel(recursiveCall(prodCategory.Category),1,1);
}

No comments:

Post a Comment

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...