INTERNET APPLICATION DEVELOPMENT
MID MARKET ERP DEVELOPMENT
by Jacky Xu
We can open a Sage 300 ERP session without using a user name and password through the Sage 300 ERP COM library “AccpacSessionManager.dll.” This is a sample from the COM library to open a session:
But, we already know the Sage 300 ERP .net library does not provide a method to do that. Sage provides a new function to get an “objecthandle” for Sage 300 ERP 2014. I want to use this new function to let the Sage 300 ERP .Net library open the session without the username and password. (You have to create a program icon on the Sage 300 ERP desktop to run it.)
1. Create a .net win-form project and add .net library reference.
2. Change the Main method to get “objecthandle” from the Sage 300 ERP desktop, and define a property to store it.
3. Define the method to open the session. I will use a Sage 300 ERP API function, so I also need to define it.
4. Get the handle of the windows form and post the new method.
5. Create the icon on the Sage 300 ERP desktop.
Now let’s try it.