How to get PurchaseOrderNo using PurchaseOrder Details & LineItems data from Sage 100 desktop application using C#?
I have using DispatchObject and done login and select company functionality.
Can you please help me to get PO detail using C#?
How to get PurchaseOrderNo using PurchaseOrder Details & LineItems data from Sage 100 desktop application using C#?
I have using DispatchObject and done login and select company functionality.
Can you please help me to get PO detail using C#?
You may want to try searching for examples on here. Most scripting for sage 100 is done in VBScript but there are a few examples for other languages.
I found this post which should give you the bulk of…
Do you need to write back to Sage 100? If not, ODBC may be easier.
can you please share the ODBC example?
Do you need to write back to Sage 100? If not, ODBC may be easier.
can you please share the ODBC example?
This is a VBScript example, but I assume you can translate the concept to C#. (SOTAMAS90 is a user DSN created when logging in to Sage 100... the user / password / company code are set higher in the script, as are the Div / Vendor values).
None of this is specific to Sage 100, except for the connection string is the syntax for the Providex ODBC driver, so you should be able to Google to find C# examples of ODBC queries.
strConn = "DSN=SOTAMAS90;UID=" & sSageUser & ";PWD=" & sSagePassword & ";company=" & sSageCompanyCode
Set DBConn = CreateObject("ADODB.Connection")
DBConn.open strConn
sSelect = "SELECT CheckEntryNo FROM AP_CheckHeader WHERE APDivisionNo= '" & sAPDiv & "' " & "AND VendorNo = '" & sVendor & "' "
Set ReturnSet = CreateObject("ADODB.RecordSet")
ReturnSet.Open sSelect, DBConn
do until ReturnSet.EoF
...
ReturnSet.MoveNext
loop
ReturnSet.Close
DBConn.Close
Thanks Kevin
Thanks Kevin
How to get an Invoice and Line Item details?
Can you please share the code or share the line item keywords?
I did get the Invoice No, Date and Shipping Address but I can not fetch the Line Items details?
One more thing, I have also got the PO & SO detail and Line Items details, but I am struggling in Invoice Line Items.
Can you please help me?
oSS.InvokeMethod("nSetDate", "S/O", DateTime.Now.ToString("yyyyMMdd")); oSS.InvokeMethod("nSetModule", "S/O"); int TaskID = (int)oSS.InvokeMethod("nLookupTask", "SO_Invoice_ui"); int setProgramTest = (int)oSS.InvokeMethod("nSetProgram", TaskID); //we create two lists to store the line keys and quantities in. List<Invoice> invoiceList = new List<Invoice>(); using (DispatchObject soObject = new DispatchObject(pvx.InvokeMethod("NewObject", "SO_Invoice_bus", oSS.GetObject()))) { soObject.InvokeMethod("nMoveFirst"); int sEOF = (int)soObject.GetProperty("nEOF"); do { var invoiceNo = soObject.GetDataObject("InvoiceNo$"); var invoice = new Invoice(); invoice.InvoiceNo = invoiceNo; invoice.ShipToAddress1 = soObject.GetDataObject("ShipToAddress1$"); invoice.OrderDate = TextUtilities.ConvertDate(soObject.GetDataObject("InvoiceDate$")); using (DispatchObject so_line = new DispatchObject(soObject.GetProperty("oLines"))) { so_line.InvokeMethod("nMoveFirst"); int EOF = (int)so_line.GetProperty("nEOF"); do { var ItemCode = so_line.GetDataObject("ItemCode$");
*Community Hub is the new name for Sage City