- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-23-2012 10:24 AM
Can anybody point me to the right direction?
I need to get shipping information from MAS and only think I know is SalesOrderNo.
What BOI should I use and how to get correct record by SalesOrderNo?
Thank you in advance,
George
MAS90 4.40
Solved! Go to Solution.
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-23-2012 10:31 AM
Welcome to the forums.
You will need to start with the SO_Invoice_bus object. There are several ways to find the records by SalesOrderNo including looping through the records until a match is found, SetBrowseFilter function, or I believe there is a way to query against the object (I don't use this one, but have seen it before).
I would just start with looping through the records as this is easy to code and there shouldn't be a ton of Invoice records to go through.
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-23-2012 10:46 AM
George,
What kind of shipping information are you trying to get?
If you want to get invoice information about a sales order that is being invoiced/shipped, you can start with using the SO_SalesOrder_svc object to get the CurrentInvoiceNo$. Then use SO_Invoice_svc (read only) or SO_Invoice_bus to get invoice details.
Sr. Software Engineer
Sage 100 ERP
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-23-2012 11:00 AM
Thank you guys for the quick answers.
I just need the basic info about shipping. I am going to try your ideas.
George
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-24-2012 11:42 AM
Hi again.
1. I could not figure out how to use SO_SalesOrder_svc. Any example would be appreciated.
2. I am currently using SO_SalesOrder_bus, here is the code
using (DispatchObject order = newDispatchObject(pvx.InvokeMethod("NewObject", "SO_SalesOrder_bus", oSS.GetObject())))
{
foreach (string ordernum in ordernumlist)
{
order.InvokeMethod("nSetKeyValue", "SalesOrderNo$", ordernum);
retVal = order.InvokeMethod("nFind");
LogMsg(string.Format("[Order# {0}] Exists? {1}", ordernum, retValText(retVal)));
if ((int)retVal == 0) //Error
{
string serror = "[Order] Error: ";
object errorMsg = order.GetProperty("sLastErrorMsg");
if (errorMsg != null)
serror += errorMsg.ToString();
LogMsg(serror);
}
elseif ((int)retVal == 1) //Exists
{
string invoice = string.Empty;
retVal = order.InvokeMethod("nGetValue", "CurrentInvoiceNo$", invoice);
LogMsg(string.Format("[nGetValue] OK? {0}", retValText(retVal)));
LogMsg(string.Format("[Invoice#] {0}", invoice));
}
}
}
Here is the result I am getting:
[FindInvoices] Orders: 5,115
[Order# 5] Exists? Error
[Order] Error: The 0000005 is invalid.
[Order# 115] Exists? Yes
[nGetValue] OK? Yes
[Invoice#]
Definitely there is a value in CurrentInvoiceNo for order 115.
What am I doing wrong?
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-24-2012 05:43 PM
1. SO_SalesOrder_svc is very similar to SO_SalesOrder_bus. The service class has fewer methods available because it is read only. You can use the same nSetKeyValue(), nFind(), and nGetValue() methods. However, you will need to zero-fill sales order number in the nSetKeyValue call (ie. 0000115, not 115).
2. Someone else reported that nGetValue() returned blank last week in another post. May be you are experiencing the same issue. I don't know why. I've never used C# with BOI.
Sr. Software Engineer
Sage 100 ERP
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-25-2012 09:49 AM
I asked my colleagues. Here is their suggestion:
When calling methods that pass parameters by ref they need to first setup a params object, and then use InvokeMethodByRef.
This would look something like this for GetValue:
object [] getValueParams1=new object[] {"ColumnName$",""};
oBusObj.InvokeMethodByRef(“nGetValue”, getValueParams1);
object [] getValueParams2=new object[] {"ColumnName",0};
oBusObj.InvokeMethodByRef(“nGetValue”, getValueParams2);
Sr. Software Engineer
Sage 100 ERP
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-25-2012 10:09 AM
Thank you so much Natasha. It is working now. ![]()
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-25-2012 11:56 AM
Hi again,
I have one more question regarding sGetColumns.
I am trying this
object[] getValueParams = new object[] { "MAIN", "" };
retVal = order.InvokeMethodByRef("sGetColumns", getValueParams);
and also this
string test = string.Empty;
retVal = order.InvokeMethod("sGetColumns", "MAIN", test);
and I am getting this error
Exception has been thrown by the target of an invocation.<Error: 548 in Method GetColumns$>
What is a proper syntax here?
George
Re: BOI & Shipment
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-26-2012 09:44 AM
You can try this (we didn't get a chance to test it):
object columnList = order.InvokeMethod(“sGetColumns”,”MAIN”);
Console.WriteLine(columnList.ToString());
Or:
string mystring = columnList.ToString();
Sr. Software Engineer
Sage 100 ERP


