I am creating a RoleCenter that will pull the total attendance of currently logged in user.
There is a table, let us call it MyTable that has records with the following columns.
Employee Code, Absent (this is a checkbox).
The Cue Table I have created for the RoleCentre I am creating, I created a field "Total Attendance" and want to write the following formula on its CalcFormula.
Filter through MyTable records with Employee Code that you find from USERID() then filter records with Absent unchecked.
This is how my CalcFormula looks as of now and I don't know how to properly user USERID() to get the Employee Code and then pass this value in the CalcFormula.
table 50043 "Cue Attendance"
{
DataClassification = CustomerContent;
fields
{
field(1; "Primary Key"; Integer)
{
DataClassification = CustomerContent;
}
field(2;"Total Attendance"; Integer)
{
FieldClass = FlowField;
CalcFormula = count("MyTable" where("Employee Code" = filter(USERID)));
}
}
keys
{
key(PK; "Primary Key")
{
Clustered = true;
}
}