'UF_MORESPO':
EXIT(GetUserFilter(ESUserFilter.FIELDNO(ESUserFilter."Production Resp. Ctr. Filter")));
'UF_MODFLOC':
EXIT(GetUserFilterDefault(ESUserFilter.FIELDNO(ESUserFilter."Default Prod. Location")));
ELSE
ESDynamicFilter.ShowCalculationError;
END;
END;
PROCEDURE InsertFilters@1240520002(CalculationCodeunitID@1240520003 : Integer);
VAR
ESDynamicFilter@1240520002 : Record 14123818;
ESUserFilter@1000000000 : Record 14123819;
BEGIN
// Add Code to insert new Dynamic Filters
// ESDynamicFilter.InsertDynamicFilter('MYTIME',CalculationCodeunitID,'Current Time');
ESDynamicFilter.InsertDynamicFilter(
'UF_MORESPO',CalculationCodeunitID,ESUserFilter.FIELDCAPTION("Production Resp. Ctr. Filter"));
//#003 >>
ESDynamicFilter.InsertDynamicFilter(
'UF_MODFLOC',CalculationCodeunitID,ESUserFilter.FIELDCAPTION("Default Prod. Location"));
END;
PROCEDURE GetGroupFilter@1000000000(P_FieldNo@1000000001 : Integer) : Code[80];
VAR
GroupUserSetup@1000000003 : Record 14123817;
ESUserGroupFilter@1000000002 : Record 14123819;
L_RecordRef@1000000000 : RecordRef;
L_FieldRef@1000000004 : FieldRef;
L_Filter@1000000005 : Text[150];
BEGIN
L_Filter := '''''';
GroupUserSetup.RESET;
GroupUserSetup.SETRANGE(GroupUserSetup."Member User ID",USERID);
IF GroupUserSetup.FINDFIRST THEN BEGIN
IF ESUserGroupFilter.GetUser(GroupUserSetup."Group User ID") THEN BEGIN
L_RecordRef.GETTABLE(ESUserGroupFilter);
L_FieldRef := L_RecordRef.FIELD(P_FieldNo);
L_Filter := L_FieldRef.VALUE;
IF L_Filter <> '' THEN
EXIT(L_Filter)
ELSE
EXIT('''''');
END ELSE
EXIT('''''');
END ELSE
EXIT('''''');
END;
PROCEDURE GetUserFilter@1000000002(P_FieldNo@1000000001 : Integer) : Code[80];
VAR
GroupUserSetup@1000000003 : Record 14123817;
ESUserFilter@1000000002 : Record 14123819;
L_RecordRef@1000000000 : RecordRef;
L_FieldRef@1000000004 : FieldRef;
L_Filter@1000000005 : Text[150];
BEGIN
IF ESUserFilter.GetUser(USERID) THEN BEGIN
L_RecordRef.GETTABLE(ESUserFilter);
L_FieldRef := L_RecordRef.FIELD(P_FieldNo);
L_Filter := '';
L_Filter := L_FieldRef.VALUE;
IF L_Filter <> '' THEN
EXIT(L_Filter)
ELSE
EXIT('''''');
END ELSE BEGIN
EXIT(GetGroupFilter(P_FieldNo));
END;
END;
PROCEDURE GetGroupUserFilterDefault@1000000003(P_FieldNo@1000000001 : Integer) : Code[80];
VAR
GroupUserSetup@1000000003 : Record 14123817;
ESUserGroupFilter@1000000002 : Record 14123819;
L_RecordRef@1000000000 : RecordRef;
L_FieldRef@1000000004 : FieldRef;
L_Filter@1000000005 : Text[150];
BEGIN
//Default
L_Filter := '';
GroupUserSetup.RESET;
GroupUserSetup.SETRANGE(GroupUserSetup."Member User ID",USERID);
IF GroupUserSetup.FINDFIRST THEN BEGIN
IF ESUserGroupFilter.GetUser(GroupUserSetup."Group User ID") THEN BEGIN
L_RecordRef.GETTABLE(ESUserGroupFilter);
L_FieldRef := L_RecordRef.FIELD(P_FieldNo);
L_Filter := L_FieldRef.VALUE;
IF L_Filter <> '' THEN
EXIT(L_Filter)
ELSE
EXIT('');
END ELSE
EXIT('');
END ELSE
EXIT('');
END;
PROCEDURE GetUserFilterDefault@1000000001(P_FieldNo@1000000001 : Integer) : Code[80];
VAR
GroupUserSetup@1000000003 : Record 14123817;
ESUserFilter@1000000002 : Record 14123819;
L_RecordRef@1000000000 : RecordRef;
L_FieldRef@1000000004 : FieldRef;
L_Filter@1000000005 : Text[150];
BEGIN
IF ESUserFilter.GetUser(USERID) THEN BEGIN
L_RecordRef.GETTABLE(ESUserFilter);
L_FieldRef := L_RecordRef.FIELD(P_FieldNo);
L_Filter := '';
L_Filter := L_FieldRef.VALUE;
IF L_Filter <> '' THEN
EXIT(L_Filter)
ELSE
EXIT('');
END ELSE BEGIN
EXIT(GetGroupUserFilterDefault(P_FieldNo));//Default
END;
END;
*This post is locked for comments