Options

When Show All is Done i Can see each and every record

Stivan_dsouza21Stivan_dsouza21 Member Posts: 218
When User does show alll he should not see any record other then the setup done in cso mapping table. So how can i do it.
Below is the Code written on Form - OnOpenForm Trigger.


CSOMapping2.RESET;
CSOMapping2.SETRANGE(CSOMapping2."User Id",UPPERCASE(USERID));
IF CSOMapping2.FINDFIRST THEN
BEGIN
FILTERGROUP(2);
CSO.RESET;
CSO.SETRANGE(CSO."Document Type","Document Type");
CSO.SETFILTER(CSO."Short Close",'%1',FALSE);
IF CSO.FINDSET THEN
REPEAT
CSOMapping.RESET;
CSOMapping.SETRANGE(CSOMapping."User Id",UPPERCASE(USERID));
CSOMapping.SETRANGE(CSOMapping.Type,CSOMapping.Type::"Responsibility Center");
CSOMapping.SETRANGE(CSOMapping.Value,CSO."Responsibility Center");
IF CSOMapping.FINDFIRST THEN
CSO.MARK := TRUE
ELSE
BEGIN
CSOMapping1.RESET;
CSOMapping1.SETRANGE("User Id",UPPERCASE(USERID));
CSOMapping1.SETRANGE(Type,CSOMapping.Type::Location);
CSOMapping1.SETRANGE(Value,CSO."Location Code");
IF CSOMapping1.FINDFIRST THEN
CSO.MARK := TRUE
END;
UNTIL CSO.NEXT = 0;
CSO.MARKEDONLY(TRUE);
COPY(CSO);
FILTERGROUP(2);
END
ELSE
BEGIN
IF UserMgt.GetSalesFilter() <> '' THEN BEGIN
FILTERGROUP(2);
SETRANGE("Responsibility Center",UserMgt.GetSalesFilter());
FILTERGROUP(0);
END;
END;




Thanks in Advance.
Thanks & Regards,
Stivan D'souza

Comments

Sign In or Register to comment.