Problem With Session Virtual Table in SQL

Does anybody knows if there are any issues when using the Session Table using NF (2.60 D) SQL ? I need to prevent concurrent users going to the same module with the same Navision User ID so for this I’ve used the session table The code in charge for the checking is as follow : // Check For Concurrent Navision User Session.SETRANGE(“User ID”, USERID); Session.SETRANGE(“My Session”, FALSE); IF Session.FIND(’-’) THEN ERROR (‘You cannot login, User %1 is already logged in’, USERID); The code works fine in Navision Native but in SQL I get (times to times) some funny error message when this code is executed. Of of the funny message I get when this code is run is : The definition of the field User ID was changed after the object was saved. Old Type : Code New Type : Text (By the way no object was changed, I’m the only on this database!) Has anyone experienced a similar problem ? tarek_demiati@ureach.com

Hi Tarek, recently I have experienced very similar problem with exactly the same error message. In my case did the trick the statement CURRENTTRANSACTIONTYPE := TRANSACTIONTYPE::Update Hope this helps Michal

Tarek, This time, surprisingly, the error message is fully to the point and correct! As it happens to be, the datatype of USERID in the session table is CODE for native Navision, but TEXT for SQL. Normally you won’t notice this, only when you do something like you’re doing. :slight_smile: Solution: Just recompile the object with this code under SQL. John

Thanks John, I did recompile my object under SQL and it indeed fixed the problem. tarek_demiati@ureach.com