This topic is locked

Filter Lookup using Custom GroupID

2/10/2011 8:19:57 PM
PHPRunner General questions
romaldus author

can used in Dynamic Permission project

On PHPRUNNER manual i found that:

[/color]$_SESSION["GroupID"]

GroupID that user belongs to. Populated if User Group Security turned on (used for static permissions only).

CARS_TABLE[/b]



JXK12345567..............2................... AVAILABLE

GGR86654456.............1.................. AVAILABLE

LMH55879878.............2...................SOLD

YFB77534950..............3...................AVAILABLE

GYU87999987.............3...................SOLD
[color="#ff0000"][b]WEB_UGMEMBERS

SCOTT.............. 1

JOHN................ 2

JEANE............... 2

SEAN................ 1

BRAD................ 2
[color="#ff0000"]CAR_SALES

**<---------------------- the problem is here

  1. on [color="#ff0000"][b]CAR_SALES**add page before process i use this custom code to make Custom GROUPID:



$rstmp = CustomQuery("select GroupID from web_ugmembers where UserName='".$_SESSION["UserID"]."'");

$datatmp = db_fetch_array($rstmp);

$_SESSION["CustomGroupID"] = $datatmp["GroupID"];


2. setup the and then add this code to where expression:

"DEALER_ID=".$_SESSION["CustomGroupID"] and "STATUS='AVAILABLE'"


i want to filter the lookup field based on CustomGroupID
for example :

username SCOTT can only lookup records where DEALER_ID equals to his GROUP_ID and status = available. from above example scoot can only lookup GGR86654456from engine number field.
PROBLEM:

on PHPRUNNER generated app, login as SCOTT and then go to the car_sales add page.

Something is wrong when LookUp the engine number, All engine number records listed in lookup.
i want Scott can only lookup from cars_table where DEALER_ID =1 and status = available
what's wrong with the code? Thanks...


Sergey Kornilov admin 2/11/2011

As a first step I would fix a syntax error in WHERE clause. Try this:

"DEALER_ID=".$_SESSION["CustomGroupID"] ." and STATUS='AVAILABLE'"


If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

romaldus author 2/11/2011



As a first step I would fix a syntax error in WHERE clause. Try this:

"DEALER_ID=".$_SESSION["CustomGroupID"] ." and STATUS='AVAILABLE'"


If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Error on generated apps:


Sergey Kornilov admin 2/14/2011

How do you want us to help?

E
ericholiveira 2/18/2011

Hello, I'm having a similar problem.


How to get the value of the field mode (inline edit) and filter the lookup wizard?

romaldus author 2/24/2011



As a first step I would fix a syntax error in WHERE clause. Try this:

"DEALER_ID=".$_SESSION["CustomGroupID"] ." and STATUS='AVAILABLE'"


If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


i have posted the project on demo account...and open new ticket (romaldus@gmail.com)

romaldus author 2/24/2011



As a first step I would fix a syntax error in WHERE clause. Try this:

"DEALER_ID=".$_SESSION["CustomGroupID"] ." and STATUS='AVAILABLE'"


If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


admin said : this kind of help is provided to registered customers only.