I've got a users table with a lookup into itself so that users can be put under other users for referral-tracking purposes.
However, I need to prevent users from being put under themselves, so I've been trying to filter out the current user record using its key (Profile_ID) which is a hidden field in the edit form. I've tried almost every variation of filter statement I can think of (even taken from the example in the help file) i.e.
(intval(CurrentPage()->Profile_ID->CurrentValue) > 0) ? "Profile_ID
!= " . strval(CurrentPage()->Profile_ID->CurrentValue) : ""
...but nothing works - either all users appear in the lookup, or none do. The only functional filter has been a static one:
"Profile_ID
!= 100004"
When the "Referrer" field is null in the DB, the details of the current user record (Profile_ID and Profile_Owner) are displayed as though they have been selected from the lookup.
Any thoughts?