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

Stivan_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.
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
Stivan D'souza
0
Comments
-
Did you try by simply writing FILTERGROUP(2); in the beginning of OnOpen form and FILTERGROUP(0); at the end rather than writing those many times?0
-
Ya. its not working if FILTERGROUP(2); in the beginning of OnOpen form and FILTERGROUP(0); at the end.Thanks & Regards,
Stivan D'souza0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions