Filter table not working

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
thalassa3000
User
Posts: 7

Filter table not working

Post by thalassa3000 »

Hi,

I'am trying to filter a table or view based on the logged in user.

tblorders, contains orders that are assigned to a user. The current user only has to see the records that are assigned to him. The tblorders has a column userid for this.
tblusers, contains the userdata, with the id column as the id of the user
I used the advanced security, where I selected the tblusers and the id collum as userid

For this I use the record selecting event:

// Recordset Selecting event
function Recordset_Selecting(&$filter) {

ew_AddFilter($filter, "userID = '".CurrentUserID()."'");

When logged in as the user with the id = 1, no records show up. The tblorders does contains records with the userid = 1.

Please help me into the right direction. Thx!


mobhar
User
Posts: 11905

Post by mobhar »

How about this?

ew_AddFilter($filter, "userID = ".CurrentUserID()."");

Perhaps the userID is an integer field type, so, no need to quote the value?


thalassa3000
User
Posts: 7

Post by thalassa3000 »

Yep, that did the trick.

Thanks a million!


Post Reply