hi,
Aged Accounts Receivable Report,
When i Put multiple Responsibility Center the the Below Code does not work.
CustResCenterFilter := Customer.GETFILTER(Customer."Responsibility Center");
Memberof.RESET;
Memberof.SETRANGE(Memberof."User ID",USERID);
Memberof.SETRANGE(Memberof."Role ID",'MARKETING');
IF Memberof.FINDFIRST THEN
BEGIN
CSOmapping.RESET;
CSOmapping.SETRANGE(CSOmapping."User Id",USERID);
CSOmapping.SETRANGE(CSOmapping.Type,CSOmapping.Type::"Responsibility Center");
CSOmapping.SETRANGE(CSOmapping.Value,CustResCenterFilter);
IF NOT CSOmapping.FIND('-') THEN
ERROR('You are not allowed to run the report other than your Responsibility Center')
END;
Please suggest.
Thanks & Regards,
Stivan D'souza
0
Comments
BR
Hawkeye
Edit:
If Not then you should ad
End else
Error('You do not have the marketing role... (or something)');
should be
csomapping.setfilter
Because you get a filter, but you set a range at the moment.
BTW this only works for SQL users, windows users will always be able to run this report (or never if you add the code of hawkeye)
|To-Increase|
I assumed that they did not use windowslogon because of the code - but if I was wrong - that might be the problem.
BR
Hawkeye
1 - show us the code, which you did, so that's good
2 - tell us what you expected to happen
3 - describe what actually happened
By only giving us the code, you are not actually telling us what the problem is. One thing is for sure though, and that is that code ALWAYS does EXACTLY what you tell it to do.
RIS Plus, LLC
CSOmapping.SETRANGE(CSOmapping.Value,CustResCenterFilter);
Stivan D'souza