I Created a Cue for "Sales This Year" considering Sales(LCY) field in Customer Ledger Entry. It worked well and got my Sales This Year Cue in My Business Center Role Center. In the same way, I tried to create another Cue to Show the total value of "Remaining Amt (LCY)" field in Customer Ledger Entry. If I add the field for "Remaining LCY" in Table as well as Page, I get the following error as An unexpected error occurred after a database command was cancelled.. what went wrong in my code? How to get a Cue in my role center showing Remaining Amt (LCY) in Customer Ledger Entry? I have added my code as follow:
tableextension 50106 CueSaleNRemainingAmtTable extends "Activities Cue"
{
fields
{
field(50000; CueFields; Decimal)
{
FieldClass = FlowField;
CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('-1Y' .. 'CD')));
Caption = 'Sales Amount This Year';
AutoFormatExpression = GetAmountFormat();
AutoFormatType = 11;
DecimalPlaces = 0 : 0;
}
field(50001; RemainingLCY; Decimal)
{
FieldClass = FlowField;
CalcFormula = sum("Cust. Ledger Entry"."Remaining Amt. (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('-1Y' .. 'CD')));
AutoFormatExpression = GetAmountFormat();
AutoFormatType = 11;
DecimalPlaces = 0 : 0;
}
}
}
pageextension 50106 CueSaleNRemainingAmtPage extends "O365 Activities"
{
layout
{
addafter("Sales This Month")
{
field(CueFields; Rec.CueFields)
{
ApplicationArea = Basic, Suite;
Caption = 'Sales This Year';
DrillDownPageID = "Customer Ledger Entries";
}
}
addafter("Overdue Purch. Invoice Amount")
{
field(RemainingLCY; Rec.RemainingLCY)
{
ApplicationArea = Basic, Suite;
Caption = 'Remaining Sales Amount';
DrillDownPageID = "Customer Ledger Entries";
}
}
}
}