Hi,
My client requirement is to show "sales this month" based on the sales done by himself. How to set filter for the same?
So wrote a code like below: but getting Error: The following fields must have the same type:Field: User ID <-- Created By
Table: Cust. Ledger Entry <-- Activities Cue
Type: Code <-- GUID.
but both user ID and created by fields are GUID data type only.
field(70000; SalesThisMonth; Decimal)
{
FieldClass = FlowField;
//CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('-1Y' .. 'CD')));
CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Document Type" = filter(Invoice), "Posting Date" = filter('CM'), "User ID" = field(SystemCreatedBy)));
Caption = 'Sales Amount This Month';
AutoFormatExpression = GetAmountFormat();
AutoFormatType = 11;
DecimalPlaces = 0 : 0;
}