Within Acumatica, we have an external js application that is brought inside Acumatica. We bring it in by creating a new screen/screen id, and within this template, we just include the js and css files, and the javascript application loads in. Up until now, there has been very little need for interaction between Acumatica and this 3rd party JS application.
We have since developed interaction between this javascript application and Acumatica by utilizing the Acumatica http rest apis to create, view, and manage Sales Order Documents.
So the use case is that an internal user will log into Acumatica via the UI. Then they navigate to this Custom Screen, which loads in the javascript application. Then this JS application starts making api calls to read/write to Acumatica Sales Orders.
As of now, we were planning to use a hardcoded username/password for the api calls within the javascript application. But upon further testing, we are seeing a session crossover between the logged in user's UI session and the hardcoded API credentials. Once we start interacting with the API, we noticed that the username in the upper right of the screen changes to the api user instead of keeping to the logged in UI session user.
So clearly, we are either doing something wrong, OR our approach is flawed. I'm guessing it's the latter. I'm hoping that someone can provide some direction as to a more sound/stable approach to how we should handle the API account vs UI logged in session accounts. We aren't likely to change our use case, so it's about figuring out how to best structure the api calls vs the UI sessions, etc...
Any help would be much appreciated.
NOTE: we are on 2019 r1