Options

Filtering on Sales Budget Matrix Form

GreatMaharGreatMahar Member Posts: 11
Hi,

I would like to add in new filter on Sales Budget Overview Form. What i need is when Filter by Customer Filter If the Rows are showing Item, I want to get Item only can find the Items in Sales Price Table by that Customer. I try to Replace Dimension Code Buffer with Sales Price Table instead of Item Table. But all the rows mess up and showing duplicates records and when click and then it is replaced. Here are my Codes:

I modified at two function in Code Unit 7130, Item Budget Management as follows:

in FindRec Function as follow:

GetGLSetup;
CASE DimOption OF
DimOption::Item:
BEGIN
Item."No." := DimCodeBuf.Code;
IF ItemFilter <> '' THEN
Item.SETFILTER("No.",ItemFilter);

//My Modification.
g_blnSalesPrice := FALSE;
IF ItemBudgetName."Analysis Area" = ItemBudgetName."Analysis Area"::Sales THEN BEGIN
IF SourceNoFilter <>'' THEN BEGIN
g_blnSalesPrice := TRUE;
g_recSalesPrice."Item No." := DimCodeBuf.Code;
g_recSalesPrice.SETRANGE("Sales Type",g_recSalesPrice."Sales Type"::Customer);
g_recSalesPrice.SETFILTER("Sales Code",SourceNoFilter);
IF g_recSalesPrice.FIND(Which) THEN BEGIN
g_fnCopySalesPriceToBuf(g_recSalesPrice,DimCodeBuf);
END;
END;
END;

IF NOT(g_blnSalesPrice) THEN BEGIN
Found := Item.FIND(Which);
IF Found THEN
CopyItemToBuf(Item,DimCodeBuf);
END;
//#My Modification.
END;

In NextRec Function:

GetGLSetup;
CASE DimOption OF
DimOption::Item:
BEGIN
Item."No." := DimCodeBuf.Code;
IF ItemFilter <> '' THEN
Item.SETFILTER("No.",ItemFilter);

//My Modification
g_blnSalesPrice := FALSE;
IF ItemBudgetName."Analysis Area" = ItemBudgetName."Analysis Area"::Sales THEN BEGIN
IF SourceNoFilter <>'' THEN BEGIN
g_blnSalesPrice :=TRUE;
g_recSalesPrice."Item No." := DimCodeBuf.Code;
g_recSalesPrice.SETRANGE("Sales Type",g_recSalesPrice."Sales Type"::Customer);
g_recSalesPrice.SETFILTER("Sales Code",SourceNoFilter);
ResultSteps := g_recSalesPrice.NEXT(Steps);
IF ResultSteps <> 0 THEN
g_fnCopySalesPriceToBuf(g_recSalesPrice,DimCodeBuf);
END;
END;

IF NOT(g_blnSalesPrice) THEN BEGIN
ResultSteps := Item.NEXT(Steps);
IF ResultSteps <> 0 THEN
CopyItemToBuf(Item,DimCodeBuf);
END;
//#My Modification
END;

Please advice. Your Help is greatly Appreciated.

Comments

  • Options
    Maria-SMaria-S Member Posts: 90
    Hello GreateMahar,

    Why do you need this line?
    g_recSalesPrice."Item No." := DimCodeBuf.Code;

    It seems to me useless in your code :-k
Sign In or Register to comment.