Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Astute Commentator
Posts: 16
Registered: ‎04-15-2009
Accepted Solution

Datagrid filter by userid

Hi Everyone

 

I created an Account form with datagrid in it that dispaly values from a custom table.

Itisfilteredtodisplayonlyrecordsofthataccount (nativeconfiguration)

 

I would like to filter/display the records only for the current logged in user.

In the query builder under the SQL property, I tried to set the CREATEUSER = :userid like I do in groups but that did not work.

Any ideas on how to filter it?

 

Thanks

 

Oren

Highlighted
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: Datagrid filter by userid

Dim SQL, cUserID, myAccountID

CUserID = Trim(Application.basicfunctions.currentuserid)

myAccountID = Application.BasicFunctions.CurrentAccountID

SQL = "Select ....... From Table A1 WHERE A1.ACCOUNTID = '" & myAccountID  & "' AND A1.CREATEUSER = '" & cUserID   & "' "

grid.sql.text = SQL

RJ Samp
Highlighted
Astute Commentator
Posts: 16
Registered: ‎04-15-2009

Re: Datagrid filter by userid

RJ

you are awesome.
Thank you very much.

works like a charm.

Oren
Highlighted
Silver Contributor
Posts: 835
Registered: ‎03-24-2009

Re: Datagrid filter by userid

In the old days you had to

grid.sql.text = sql

grid.refresh

 

and you still see some of that code around (or even freshly coded!!!). That's two round trip retrievals of the same data.......

RJ Samp