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.
Try this:
... AND {User}.[Username] NOT LIKE 'ABC' + CHAR(92) + '%'
The \ character is being escaped by OutSystems before being sent to the database.