Hi Guys,
Does anyone have a solution for running a odata query in excel but it won’t run because the user is currently in the wrong company in their epicor UI session?
I tried giving the query the company argument but that didn’t fix it.
Only solution i can think of is adding making the query available in all companies and using a filter in it.
We are on 10.2.100.17 so maybe it’s fixed in the v2 api.
@PatL This is a problem when working outside of Epicor. Epicor holds a user’s ‘company context’ (the last company used) in order to apply a company context for other connections like ODATA. Logins will continue to use the security from inside Epicor because there is no way to select the login company when using ODATA. (I might be wrong on this, but I’ve not seen a way to do it)
Making the query multi-company and using a filter will work for the user, as you do not have to make the query available in every company if you do not need it to be.
If you make it available to all companies, but not multi-company in the BAQ, then your user will need to have access to that company - but since you cannot choose the company on the ODATA connection, this will not do what you want.
In general, I make all of my queries available in all companies AND multi-company. This forces my users (most of whom have access to more than one company) to consciously pay attention to the company selection/filter whether they are inside Epicor or outside (Execl, EDA, etc.).
Advanced SQL solution - this might be out of your scope, but it’s another way if you are comfortable in SQL and your installation is on-prem versus hosted in the cloud. I also created a ‘readonly’ user at the SQL level that is denied the ability to write to the DB (Server Roles in the User Login, Database Mapping tab) and which has a fixed password. I often use this for ODATA connections that use SQL inside Excel, or that call my own stored procedures (stored in another database) for queries too complicated for BAQs.