UserID_Filtering not firing

Hi,need to filter out the records of the report based on the current userid, but when I put breakpoints at: (v2020)function UserID_Filtering(&$filter)

the function is never being executed/called. are they not accessible via a report.
4 different reports behaving the same way.

hi,reproduced in the demo project also… UserID_Filtering() is not fired.i don’t having any code in the function yet, just put a breakpoint in the function and never hit.pick any report they seem to all be doing the same, I used sales by custonmer and Sales by Category for 1997

For the UserID_Filtering server event, please check if you have enabled User ID Security for the reports. Otherwise the server event is not generated.

regenerated with 2020.07 and function is present, but when report is executed, doesn’t execute the functionI have user id security enabled. Also did a search through the reports and couldn’t locate any calls to UserID_Filtering().
not sure whats wrong.

sticcino wrote:
reproduced in the demo project also… UserID_Filtering() is not fired.
pick any report they seem to all be doing the same, I used sales by customer and Sales by Category for 1997What is the User ID field of those reports? In the demo project, User ID is EmployeeID, but there is no EmployeeID in above 2 reports.arbei wrote:
For the UserID_Filtering server event, please check if you have enabled User ID Security for the reports. Otherwise the server event is not generated.

For the sample project… I just put breakpoints in the function below, expecting them to be hit.the reports are based on views… I’ve added the UserId field to the view and selected it on the report… I also have the userId displayed on the report to verify and test

the userid I use for every table is UserIdi’m under the impression that the function below would fire everytime the report is run so you can alter the filter?, what we want to achieve is to display on the records for the current user, not all the user records

// User ID Filtering event
function UserID_Filtering(&$filter) {

	// Enter your code here
            echo "test"; <<<<<<< BREAKPOINT SET, never executed
}

sticcino wrote:
echo “test”; <<<<<<< BREAKPOINT SET, never executedDon’t just add that code to test. You should write your code just like described in Help file, for example:AddFilter($filter, "MyUserIDField2 = " . CurrentUserInfo(“MyUserIDField2InUserTable”)); // Assume the field is of integer type