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

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...