NewUser
(Juan Corrales)
January 26, 2023, 3:14pm
1
Good day,
I am trying to create a record for Epicor Function Maintenance but I need to change user when doing this process.
I have multiple companies set up in Epicor. From a function I am trying to create the same record in all companies, but business rule, the user does not have access to all companies. To create it I must use a different user per company.
I am trying something like this:
string config = “c:\Epicor\Config\Production.config”
Ice.Core.Session sessionEpi = new Ice.Core.Session(user, pass, “Production”, Ice.Core.Session.LicenseType.Default, config);
Function throws error on “Ice.Core.Session” but that dll doesn’t exist in functions.
Does anyone know how I can login a different user from a function?
klincecum
(Kevin Lincecum)
January 30, 2023, 4:44am
2
There is probably a slick way to do it , but one way is to call into one function,
and use rest with different credentials to call your final function.
You might want to drop some security checks on that first function, depending.
User A – Calls Function FuncOne
FuncOne, using different credentials , calls FuncTwo via the Rest API
1 Like
NewUser
(Juan Corrales)
January 30, 2023, 12:34pm
3
.Ok, but, I need an example of how to create the login because the way I’m doing it doesn’t work correctly.
NewUser
(Juan Corrales)
January 30, 2023, 2:02pm
5
NewUser:
string config = “c:\Epicor\Config\Production.config”
Ice.Core.Session sessionEpi = new Ice.Core.Session(user, pass, “Production”, Ice.Core.Session.LicenseType.Default, config);
I am trying using that but I am exploring a new way to login by “API-REST”
klincecum
(Kevin Lincecum)
January 30, 2023, 2:10pm
6
I’ll see if I can work you up a simple example, since I can’t find exactly
what I’m looking for in the search.
In the meantime, here is a thread that should get you started using RestSharp:
(With or without using his cool little function.)
https://www.epiusers.help/t/custom-library-for-sending-rest-calls-out-of-epicor/83881
You should be able to use that, and the swagger pages to figure it out.
Hogardy
(Pierre Hogue)
January 30, 2023, 3:24pm
7
Actually, that is how I connect with my .Net DLL’s
var session = new Ice.Core.Session("id", "pw", Ice.Core.Session.LicenseType.Default, @"C:\EpicorClient\ErpPilot\config\ErpPilot.sysconfig");
But with the new version Kinetic, my VS gave me warnings that it is obsolete. (but still works though… )
What is GUID license type ?
and I did not find Erp.License anywhere ?
Can someone enlight me on how to change the session string ?
thanks.
Pierre
gunny72
(Mark Gunston)
November 30, 2023, 2:21pm
8
Hi Pierre,
I think external Dll’s are being phased out - you are better off moving to REST to connect.
Thanks
Mark
1 Like
t.mattick
(Tracy)
February 19, 2024, 4:33pm
9
Hi
Did you manage to get this working, I am now having the same issue
Would appreciate any help you can give
Vincent
(Vincent)
May 8, 2024, 12:38am
10
Hi I phase the same thing on this as simple session connect which is working find previously in E10 and now come to E11 (Kinetic) with the latest dll is not working anymore, I get the null reference object error.
private static Session epiSession = new Session(
UserID,
Password, "",
Session.LicenseType.DataCollection,
ConfigPath, false,
CompanyID,
PlantID);
gunny72
(Mark Gunston)
May 8, 2024, 11:08am
11
Hi Tracy,
The old way is:
var session = new Ice.Core.Session("id", "pw", Ice.Core.Session.LicenseType.Default, @"C:\EpicorClient\ErpPilot\config\ErpPilot.sysconfig");
new way is:
var epiSession = new Ice.Core.Session("UserName", "", "", Ice.License.LicensableUserCounts.DefaultUser, @"C:\Epicor\cag-vm-erpapp01\ERP11.2.400.6Client\Client\config\EpicorERP.sysconfig", False, "CABP", "MfgSys")
Hope this helps!
Thanks
Mark
Vincent
(Vincent)
May 13, 2024, 10:13am
12
Hi Thanks,
but i still facing the same error on detect null reference even has point correctly.
just I’m confuse the yellow highlight was input on the user ID or name?
The license load seems like different from origin and is there any reference need to load for this ? i have a error not found on this config.
the App url can be empty am I correct?
Please help and we have some E10 application need to load and run for kinetic