SetCompany() results in multiple logged in users
Aldevinas Katkus
12-13-22
Operating system: Windows
Is it a feature or a bug?

I used to invoke an import procedure from Technics>>Settings>>Timed operations, HAL routine and, suddenly, after changing non-related hal files the SetCompany(compnr,false) started to result in multiple logged in users (of the same user, who logged in first from a client) prohibiting other users to log in into single user companies.
I solved it with
if (ServerMode) then begin
SomeImportIn;
end;

and checking if DirExists() in the SomeImportIn(), because on the client PC import directory does not exist.
I suspect if FileNameFromFolder(nonexistingpath,"") below fails, then ResetCompany() is not executed and we have a user logged in into the company, even though SetCompany(tocompany,false) shouldn't affect logged in users count.
The most interesting part is that it worked for years and I haven't touched that SomeImportIn().

curcomp = CurrentCompany;
if (SetCompany(tocompany,false)) then begin
filename = FileNameFromFolder(nonexistingpath,"");

ResetCompany(curcomp);
end else begin

ResetCompany(curcomp);
end;
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Lilian Wanyoike
Hi, Spinners & Spinners are currently on version 8.5 2022-02-02 (build 85420830). they have been experiencing a network lag. Action taken: - Checked logs and confirmed that they had not whiteli...
14:13 30 Aug 2024
Lilian Wanyoike
Hi, Spinners & Spinners are currently on version 8.5 2022-02-02 (build 85420830). they have been experiencing a network lag. Action taken: - Checked logs and confirmed that they had not whiteli...
14:13 30 Aug 2024