This topic is locked
[SOLVED]

 HELP! Dropdown with Lookup not working

9/27/2013 11:53:05 AM
PHPRunner General questions
J
jco author

PHPRunner 6.2
Help, I'm stuck!
I have an ADD Page with a dropdown field "owner" which is a lookup into a view of my users table.

No matter what user I select from the dropdown it always saves the loggedin user $_SESSION["UserID"] !! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=21397&image=1&table=forumtopics' class='bbc_emoticon' alt=':angry:' />
Any ideas as to what might be happening? Has anyone ever encountered this?
Thanks in advance
Jose

Sergey Kornilov admin 9/27/2013

Make sure you are not using "Users can see and edit their own data only" security option on this table. If you use this option all records you create will be assigned to the current user and this what I guess is happening.

J
jco author 9/27/2013

Hi Sergey, that's exactly it! but I need to ensure that users can access only certain records. I have read about an alternative method through the "Before SQL query" Event...
Can you point me in the right direction?
Thanks!
Jose

Sergey Kornilov admin 9/28/2013

You simply need to remove this field from the Add page - in this case it will be assigned to the person who created it automatically.
If you need admin person to be able to create records and assign them to different persons (I believe this is what you trying to achieve) create a new Custom View in PHPRunner exclusively for admin person and do not apply "Users can see and edit their own records only" mode to this view. Make sure that this view is accessible by the admin person only. This is it.

J
jco author 9/29/2013

Sergey. I created a view of the table, assigned "Users can see and edit their own data only" to the View, and ensured that only the "admin" (and "manager") group can access the Source Table. It works perfectly!!
Thanks! Really appreciate it!
JC