Quantcast
Channel: Sage 100
Viewing all articles
Browse latest Browse all 37138

Forum Post: BOI beginner NewObject fail on SY_Session C# example 2

$
0
0
Hello everyone.  Thanks for being patient on a question that has been asked a lot. In trying to use the C# example 2 to connect to sage via the BOI, I cannot get past the InvokeMethod on SY_Session NewObject.  It does off every time depending on the path used it gets different errors.  I just cannot figure out what is going on. Environment is Sage 100 2013 on a server.  Workstation software loaded.  I can login using the regular Sage workstation software and regular desktop operations work perfectly.   But this code, from the C# example 2 fails at the SY_Session NewObject (the second using block) static void Main(string[] args) {     // Instantiate a ProvidexX.Script object and initialize with the path to MAS90\Home     using (DispatchObject pvx = new DispatchObject("ProvideX.Script"))     {         // Replace the text "*PATH TO MAS90\HOME*" with the correct MAS90\Home path in the line below         //string Path = @"E:\Sage\Sage 100 ERP Workstation\MAS90\HOME"; // Error 90 on NewObject SY_Session           string Path = @"\\vmmas\Sage 100 Premium ERP\MAS90\HOME"; // Error 200 on NewObject SY_Session         //string Path = @"\\vmmas\Sage 100 ERP Workstation\MAS90\HOME"; // Error 90 on NewObject SY_Session         //string Path = @"Z:\MAS90\Home"; // Error 90 - Mapped drive from workstation to vmmas server ERP Workstation folder           pvx.InvokeMethod("Init", Path); // Works fine here.         // Instantiate a new Session object and initialize the session         // by setting the user, company, date and module         using (DispatchObject oSS = new DispatchObject(pvx.InvokeMethod("NewObject", "SY_Session")) ) // Dies here         {              oSS.InvokeMethod("nLogon");              oSS.InvokeMethod("nSetCompany", "ABC");              oSS.InvokeMethod("nSetDate", "A/R", "05312006");              oSS.InvokeMethod("nSetModule", "A/R");              ... (and so on) I am at a loss as I can only get error 90 or error 200 (on the InnerException).  I've tried several resolutions posted a few years ago, but to no avail.  The Init works perfectly with any of the Path values. Workstation is Win7 64 bit with vs2013. Thanks in advance for any ideas.

Viewing all articles
Browse latest Browse all 37138

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>