I have a use case where Creatio App needs to be connected to a 3rd party system always. Please help with following questions
1. How to trigger source code that establishes the connection with the 3rd party system? Its possible to run a Business Process, but if there is any other way, it could help.
2. How to get AppConnection/ Userconnection? Since the code is not triggered from client/Business process or API service (no inheritance from BaseService), how can I get the AppConnection?
But looks like AppConnection is not a static class and I get the error in IDE as below. Please advice if I am doing something wrong or if the above suggestion does not work
In short passing the user connection from script task to call a source code or using BaseService for Web APIs is the only way to get userconection?
Update : One can create a new source code schema with a class that inherits from AppEventListenerBase.
The class has UserConnection as a property. The UserConnection can be set using methods given in the code below. The onAppStart is called everytime IIS (webserver) is restarted or after compilation.