Comparing to USERID

Something that I have just noticed and I’m not sure whether I am missing something or not. When a User logs in in Lower Case or a Mixture of Lower and Upper Case the USERID at the bottom right of the screen shows the USERID as they have logged in. If you use the variable USERID then to do a get from the User Setup table i.e. UserSetup.GET(USERID) all works fine and the USERID is obviously converted to Upper Case. However if you compare the USERID to a field, that is validated against the User Setup table, not using the GET function the USERID variable stays as Lower Case. i.e IF USERID <> HRSetup.“HR Manager” will not work if the user hasnt logged in all in Upper Case. Just a bit of a Gotcha that had me stumped for a while.

Hi, Same here, you will get a text to code conversion error when you are doing a compare of the userid when using SQL server. We modified all the comparing statements to force the uppercase by using. If USERID = Uppercase(table.“user id”) then… Thanks, Best regards, Prashanth NCFC, NCMC, NCSD

Under C/SIDE the USERID field is of type CODE, whereas under SQL it is of type TEXT. This means that under C/SIDE the content will always be in uppercase, but under SQL is will be just as typed in. To stay on the safe side under SQL, always use the method Prashanth suggests, in other words be sure to convert to uppercase before comparing. John