25. Februar 2013 10:54
CalcCustAdjmtCostLCY(VAR Customer : Record Customer) : Decimal
WITH ValueEntry DO BEGIN
SETCURRENTKEY("Source Type","Source No.");
SETRANGE("Source Type","Source Type"::Customer);
SETRANGE("Source No.",Customer."No.");
SETFILTER("Posting Date",Customer.GETFILTER("Date Filter"));
SETFILTER("Global Dimension 1 Code",Customer.GETFILTER("Global Dimension 1 Filter"));
SETFILTER("Global Dimension 2 Code",Customer.GETFILTER("Global Dimension 2 Filter"));
SETRANGE(Adjustment,TRUE);
CALCSUMS("Cost Amount (Actual)");
EXIT("Cost Amount (Actual)");
END;
1. Source Type,Source No.,Item No.,Posting Date,Entry Type,Adjustment; Discount Amount,Cost Amount (Non-Invtbl.),Cost Amount (Actual),Cost Amount (Expected),Sales Amount (Actual),Sales Amount (Expected),Invoiced Quantity
2. Source Type,Source No.,Global Dimension 1 Code,Global Dimension 2 Code,Item No.,Posting Date,Entry Type,Adjustment; Discount Amount,Cost Amount (Non-Invtbl.),Cost Amount (Actual),Cost Amount (Expected),Sales Amount (Actual),Sales Amount (Expected),Invoiced Quantity
25. Februar 2013 11:36
25. Februar 2013 12:30
fiddi hat geschrieben:SQL oder Native?
bei ersterem ist es evtl. sinnvoll, den SETCURRENTKEY ganz weg zu lassen, bzw. den Schlüssel nicht pflegen zu lassen, damit der SQL-Server sich den besten Schlüssel selbst sucht.
Gruß, Fiddi
25. Februar 2013 12:42
26. Februar 2013 09:20