hello
I use asp.net make 2021
and want to get data from table according to current user info such as (currentuserid()) and so on.
I try many time in filer editor/table option and no record output .
please am really need to help
Thanks
Table filtering according to current user info
-
- User
- Posts: 100
Table filtering according to current user info
-
- User
- Posts: 100
MichaelG wrote:
Show your table filter.
"Sub_dept_ID= CurrentUserID()"
or
"Sub_dept_ID= 'CurrentUserID()'"
this the filter which has written in the table filter editor
Sub_dept_ID : is the field name (integer)
when I use :
"Sub_dept_ID= '1'" will work fine because i put constant , but when use current user id or something else so nothing output
thank you dear
-
- User
- Posts: 100
"Sub_dept_ID= CurrentUserID()"
or
"Sub_dept_ID= 'CurrentUserID()'"
this the filter which has written in the table filter editor
Sub_dept_ID : is the field name (integer)
when I use :
"Sub_dept_ID= '1'" will work fine because i put constant , but when use current user id or something else so nothing output
thank you dear
-
- User
- Posts: 52
I have a related question and I am trying to filter the displayed dropdown value based on the user level
See my syntax below. Please recommend any edit as this is not working.
If '" + CurrentUserLevel() + "' = '4'
Then
"Request_Status IN ('Pending Approval','Submitted For Approval','Cancelled')"
ELSE If '" + CurrentUserLevel() + "' = '5'
Then
"Request_Status IN ('Submitted For Approval','Released For Payment','Cancelled')"
ELSE
"Request_Status IN ('Pending Approval')"
-
- User
- Posts: 52
I updated as instructed below
CurrentUserLevel() == 4 ? "Request_Status IN ('Pending Approval','Submitted For Approval','Cancelled')" : (CurrentUserLevel == 5 ? "Request_Status IN ('Released For Payment','Submitted For Approval','Cancelled')" : "Request_Status IN ('Pending Approval')")
and now I have the following errors
C:\inetpub\wwwroot\staging_publishing\*\Models\*View.cs(2220,46): error CS0019: Operator '==' cannot be applied to operands of type 'string' and 'int' [C:\inetpub\wwwroot\staging_publishing\*\*.csproj]
-
- User
- Posts: 151
since ANM2021, CurrentUserLevel() returns a string.
CurrentUserLevel() == "4" ? ...