1

I am working on a module which is using the Active Directory Integration. If the user logs in with the active directory credentials, the username field in table of the webpage is populeted with Domain\username (eg: ABC\username , where ABC is the domain name). I am new to outsystems and the module I am working on.

I have a new requirement where the I need to select the fields where the username doesnot start with "ABC\". I tried to create the below query but it is not working.It is pulling all the records from the User, but I need the records only if the username that doesnot starts "ABC\". I am not sure how the ABC\ gets added to the username.

 SELECT {User}.[Id],
        {User}.[Name],
        {User}.[Email],
        {User}.[Username]
 FROM {User}
 WHERE {User}.[Tenant_Id] = @TenantId AND {User}.[Username] NOT LIKE 'ABC\\\\%_' 

I tried to filter with respect to the email address as below it is working fine

 SELECT {User}.[Id],
        {User}.[Name],
        {User}.[Email],
        {User}.[Username]
 FROM {User}
 WHERE {User}.[Tenant_Id] = @TenantId AND {User}.[Email] NOT LIKE '_%@abc.com' 

Please help me with this.

4

1 回答 1

0

尝试这个:

... AND {User}.[Username] NOT LIKE 'ABC' + CHAR(92) + '%'

\ 字符在发送到数据库之前被 OutSystems 转义。

于 2015-07-15T15:27:05.203 回答