20.01.2015 Views

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Class Library Reference<br />

The Run method allows a program developed using Micro Focus Net Express and built<br />

to SYSPRO guidelines, to be invoked from the COM interface without the developer<br />

having to be concerned with XML technologies. This method cannot be used to invoke<br />

any proper e.<strong>net</strong> solutions business object.<br />

business objects available to this method are user defined.<br />

Example 5.7. ASP.NET Visual Basic codebehind for Utilities.Run<br />

' Logon and trap any exceptions<br />

Dim UserID As String<br />

Dim Obj As New Encore.Utilities()<br />

Try<br />

UserID = Obj.Logon ("ADMIN", " ", "1", " ", 5, 0, 0, " ")<br />

Catch exc As Exception<br />

Response.Write("Exception - message:" \<br />

& exc.Message)<br />

Exit Sub<br />

End Try<br />

' Run SDKRUN and read stock code B100<br />

Dim ReturnString As String<br />

Try<br />

ReturnString = Obj.Run(UserID, "SDKRUN", "B100")<br />

Catch exc As Exception<br />

Response.Write("Unable to run SDKRUN - Exception:" \<br />

& exc.Message)<br />

Exit Sub<br />

End Try<br />

Response.Write ("The Stock Description for item B100 is " \<br />

& ReturnString)<br />

' Logoff and Cancel your current Session<br />

Dim ReturnCode As Long<br />

ReturnCode = Obj.Logoff(UserID)<br />

Obj = Nothing<br />

5–9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!