Thank yoiu Savatage for your quick response! Yes, I want ABC (the person) to view only the records of A, B, C.
But after I add my code, the ABC can not only see the records of A, B, C, but also D, E, F. Please advise! Thank you very much!
I cannot do that, otherwise, when DEF login, he cannot see his sales, but only A's part since it is filtered in the tableviwe. We have serveal sales, each can only view his own sales in the report after login. Currentyly we mixed some of A's accounts with some the B's accounts, so when ABC ( to be exact, ABC is A) login and view the report, he can see his own sales (A), but he can also see some of the mixed sales (B, to be exact, it is AB since some of A's sales mixed with some of the B's sales, or AC). Please advise!
Thank you Savatage! Before we mixed the accounts, it works well. I am suing setfilter instead of setrange. You are right I am using lot of 'if'.
BTY, you mentions the configuration in the sales/purchase table, any adivce? Thank you!
Ok, now we are getting somewhere. In the report, what's the criteria (filter) you want to use for a user to view some records but not others? In other words, for your DataItems in your report, is there a field or fields we can filter on to get the desired result?
It is the item sales report with two tables (salesperson/Purchaser and Item Variant). I modified the original report, where each salesperson can only view his own sales after login. We have some big customers whom several sales share with, and so we created some new salespersons which are combined with each other, but it makes it difficult for each sales to view his individual mixed accounts sales. Currently we use the salesperson as the filter field. Could you advise?
Thank you!
Read the help on filters, on how to combine filters and which operators to use.
Also read up on setfilter and setrange in the help.
Anyway, your filter for your salespersons should be either combined or otherwise split (show own sales first and communist sales second, possible when its a report, not in a form/page without additonal programming)
For salesperson A who has worked with salesperson B and C you either filter once with the following string
A|AB|AC (equals to A or AB or AC)
B|AB|BC for salesperson B
Every time you use setrange/setfilter on a records field, the previous filter of that field is overwritten.
|Pressing F1 is so much faster than opening your browser| |To-Increase|
Comments
at one point you have 'abc' and another you have 'a','b','c'.
can you explain a bit better?
http://www.BiloBeauty.com
http://www.autismspeaks.org
But after I add my code, the ABC can not only see the records of A, B, C, but also D, E, F. Please advise! Thank you very much!
or it a report that only should show 'a' , 'b', & 'c'?
if so why not just set the DataItemTableView property to only deal with 'a' , 'b', & 'c'?
http://www.BiloBeauty.com
http://www.autismspeaks.org
where are you putting your code?
Do you have sales figures in the salesperson/purchaser table?
it confusing.
looks like you are going to need alot of "if statments" for each possibility
and use currreport.skip if it doesn't fit your criteria.
http://www.BiloBeauty.com
http://www.autismspeaks.org
BTY, you mentions the configuration in the sales/purchase table, any adivce? Thank you!
IF TempUser = 'A' THEN
BEGIN
"Salesperson/Purchaser".SETFILTER(Code, 'A') ;
TempAllow := TRUE;
END;
IF TempUser = 'A' THEN
BEGIN
"Salesperson/Purchaser".SETFILTER(Code, 'AB') ;
TempAllow := TRUE;
END;
IF TempUser = 'A' THEN
BEGIN
"Salesperson/Purchaser".SETFILTER(Code, 'AC') ;
TempAllow := TRUE;
END;
A can only see the records for AC, but cannot view his own A and AB. Please advise!
Are you trying to filter the records by the Salesperson or by the person who has logged into NAV?
Thank you!
Read the help on filters, on how to combine filters and which operators to use.
Also read up on setfilter and setrange in the help.
Anyway, your filter for your salespersons should be either combined or otherwise split (show own sales first and communist sales second, possible when its a report, not in a form/page without additonal programming)
For salesperson A who has worked with salesperson B and C you either filter once with the following string
A|AB|AC (equals to A or AB or AC)
B|AB|BC for salesperson B
Every time you use setrange/setfilter on a records field, the previous filter of that field is overwritten.
|To-Increase|