SourceExpr on PageField not running the Codeunit's Procedure?

mysamzamysamza Member Posts: 66
I am developing a RoleCenter, this RoleCenter will have a Cue (Tile) on its Page that will show a number which gets calculated in a Procedure of a CodeUnit I wrote.

My Procedure returns an Integer. To omit unnecessary code I will mimic a simple one;
codeunit 50149 Bla
{
 procedure TotalAttendance(): Integer
var

TotalCount: Integer;

begin
TotalCount := 10;
exit(TotalCount);
end;

}

Now, on my page. (A page with property type CardPart that becomes a part of page type RoleCentre) I wrote the following code;

layout
    {
        area(Content)
        {

            cuegroup(GroupName)
            {
                field("Total Attendance"; myCU.TotalAttendance())
                {
                    ApplicationArea = All;

                }
            }
        }
    }

//Global Var

Var

myCU: Codeunit Bla;

Now when I run the page, I get 0 in my Cue (Tile).
Sign In or Register to comment.