Hi Suresh Kulla,
Once I have created the Shortcut Dimensions as a Flowfield, how can I use them in the CalcFormula of a field?
Is it possible to add additional filters to an existing CalcFormula for a field, or do I need to create a whole new field to replace the existing ones and then extend the filter condition?
I suspect what needs to happen is this, create Flowfield, create new definition of a field, example here being the 'Balance' field which I have have named 'NewBalance'.
Is this the right way to do it? If so, I would need to do this for all the fields that have a CalcFormula already and there are about 15-20 of them or more.
tableextension 59100 "Extend Vendor" extends Vendor
{
fields
{
field(50000; "Shortcut Dimension 3 Filter"; Code[20])
{
CaptionClass = '1,1,3';
Caption = 'Shortcut Dimension 3 Filter';
FieldClass = FlowFilter;
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3));
}
field(50010; "NewBalance"; Decimal)
{
AutoFormatExpression = "Currency Code";
AutoFormatType = 1;
CalcFormula = - Sum("Detailed Vendor Ledg. Entry".Amount WHERE("Vendor No." = FIELD("No."),
"Initial Entry Global Dim. 1" = FIELD("Global Dimension 1 Filter"),
"Initial Entry Global Dim. 2" = FIELD("Global Dimension 2 Filter"),
"Initial Entry Shortcut Dim. 3" = FIELD("Shortcut Dimension 3 Filter"),
"Currency Code" = FIELD("Currency Filter")));
Caption = 'New Balance';
Editable = false;
FieldClass = FlowField;
}
}
}
I have also added this to 'Detailed Vendor Ledger Entry' to make the above work.
tableextension 59101 "Extend DetailVendLedgEntry" extends "Detailed Vendor Ledg. Entry"
{
fields
{
field(100; "Initial Entry Shortcut Dim. 3"; Code[20])
{
Caption = 'Initial Entry Shortcut Dim. 3';
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(3));
}
}