//Check if User allowed to Change Contact on RespCenter ResponsibilityCenter.RESET; ResponsibilityCenter.SETRANGE(Code,'3'); IF ResponsibilityCenter.READPERMISSION THEN EXIT(TRUE) ELSE EXIT(FALSE);
IF COPYSTR(Contact."Responsibility Center",3,6) <> '990100' THEN EXIT(TRUE); //Check if User allowed to Change Contact on RespCenter (*990100) ResponsibilityCenter.RESET; ResponsibilityCenter.SETPERMISSIONFILTER; IF ResponsibilityCenter.FINDSET THEN BEGIN HelpCode := RespCenterManagement.GetFullRespCenterState(Contact."Responsibility Center"); Repeat IF HelpCode = ResponsibilityCenter.Code THEN EXIT(TRUE); UNTIL ResponsibilityCenter.NEXT = 0; EXIT(FALSE) END ELSE EXIT(FALSE);
Answers
READPERMISSIONS determines if the user is allowed to read a record filtered using a FILTERGROUP (Security filter).
For your requirement check function "GetSalesFilter" of codeunit User Setup Management (ID 5700).
The function will deliver a filter-text of allowed responsibility center.