×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

MAS 200 BOI (Business Object Interface) Examples.

MAS 200 BOI (Business Object Interface) Examples.

MAS 200 BOI (Business Object Interface) Examples.

(OP)
Does anyone have some code examples of how to create Sales Orders or accessing MAS 200 objects using the BOI. I already entered the Object Interface Key in the System Configuration module, but I don't see any difference. I'm trying to do it for a C# app (ASP.NET). I already have the MAS90ObjectInterface manual but it doesn't help me that much. I'm looking for some code examples... and I can't wait for the next BOI class since it's until the end of the next month.

Any help will be really appreciated,

A.

RE: MAS 200 BOI (Business Object Interface) Examples.

Someone posted one on this forum.

Dawn

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)
I did see some posts with links that doesn't work anymore http://www.tek-tips.com/viewthread.cfm?qid=1424948&page=7
or
http://www.tek-tips.com/viewthread.cfm?qid=1452078&page=3

both links redirect to listech.net and they don't work. I also saw some post where people were suggesting taking the class instead and I wish I can take one.. but I already looked on it and it's until July 20 or 23...

If you know where is that example, I'll really appreciated if you send me the link.

Thanks.

RE: MAS 200 BOI (Business Object Interface) Examples.

Sorry about that, they are my links and I have since done some things to that site.  Let me find those files and update the link.

-Adam

RE: MAS 200 BOI (Business Object Interface) Examples.

Alright here are updated links, by the way these took a extremely long time to find and track down.  One is the course curriculum and the other is a set of examples in various languages.  The interface isn't hard to work with, but if you have some specific questions post here and I will do my best to help.

http://www.listech.net/files/BOI.zip
http://www.listech.net/files/MAS90ObjectInterface.pdf

-Adam

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)
Wow... THANK YOU very much for your great (and fast) help :) I can imagine how hard was for you to get them since I've been spending a lot of days on it and I was feeling so frustrated after my lack of success.

You just made my day (and probably my whole week) :D

I'll start working with them right away.

Ale

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)
Adam,

I ran the C# BOI Examples and I keep getting an exception where it tries to instantiate the AR_Customer_svc object:

InnerException: {"<NewObject Error: 200>" }
Source: "ProvideX.Script"
Message:"Exception has been thrown by the target of an invocation."

StackTrace    "   at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n   at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)\r\n   at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args)\r\n   at CSharp_Example_1.Class1.Main(String[] args) in c:\\*******\\csharp example 1\\class1.cs:line 42"    string

Do you why this is happening?

Btw, thanks again for your help,

Ale.

RE: MAS 200 BOI (Business Object Interface) Examples.

Honestly not to sure, for sake of speed I only ran through the VB and got those to work.  I don't know as much about C# and I ran out of time to learn.  I was going to pick it back up but sorry I can't help.  I looked at that line and to me it seems right, my guess is a parameter in there isn't correct, passing something it shouldn't.

-Adam

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)

Adam,

Thanks so much for your help. I was able to resolve my problem. Since you told me that the VBScript examples worked fine I started trying those, then I got one problem... but the example was really well commented that I found out that my original problem was that my Company wasn't allowing "External Access", so I went to my company profile and checked the "Allow External Access" option and all the examples started to work!!!!

I'm so happy :D

Thanks again,
Ale.

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)
I'm getting closer but I'm still not there: I'm trying to create a Customer record in MAS using BOI. I'm using C#, so I have to use late binding. When I call "nWrite" I get the following error (sLastErrorMsg):

"CA SAC" is not numeric.

First off, I'm not even specifying a Tax Schedule but I think It's grabbing it from the Zip Code. Second, Tax Schedule doesn't have a numeric field... It's just the Tax Abbrev and the description. Even if I specify the TaxSchedule$ I get the same error. This is my code:

using (DispatchObject oARCustomerEntry = new DispatchObject(pvx.InvokeMethod("NewObject", "AR_Customer_bus", oSS.GetObject())))
                    {                  
                        try
                        {
                            object[] nextCustomerNumber = new object[] { "CustomerNo$" };

                            //Getting Next Customer Number
                            oARCustomerEntry.InvokeMethodByRef("nGetNextCustomerNo", nextCustomerNumber);

                            Console.WriteLine(nextCustomerNumber[0].ToString());

                            object retVal = 0;

                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetKeyValue", new object[] { "ARDivisionNo$", "60" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetKeyValue", new object[] { "CustomerNo$", nextCustomerNumber[0].ToString() });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetKey", new object[] { "" });

                            Console.WriteLine(retVal.ToString());

                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "CustomerName$", "JOHN SMITH JR" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine1$", "1234 LONG DREAM ST" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine2$", "" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine3$", "" });                            
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "City$", "CITRUS HEIGHTS" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "State$", "CA" });
                            
                            Console.WriteLine(retVal.ToString());
                            
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "ZipCode$", "95621" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "CountryCode$", "USA" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "SalespersonDivisionNo$", "60" });
                            Console.WriteLine(retVal.ToString());

                            retVal = oARCustomerEntry.InvokeMethodByRef("nWrite", new object[] { "" });

                            string customerNumber = nextCustomerNumber[0].ToString();
                                                        
                            Console.WriteLine(retVal.ToString());

                            Console.Read();
                        }
                        catch (Exception ex)
                        {                  
                            object errorMsg = oARCustomerEntry.GetProperty("sLastErrorMsg");
                            Console.WriteLine(errorMsg.ToString());
                            Console.WriteLine(ex.Message);
                            Console.Read();
                        }
                        finally
                        {
                            oARCustomerObject.Dispose();
                        }
                    }

The console is displaying the Next Number then 2 and 1 and 1 and it breaks when I called nWrite.

Any ideas... I know the code is really ugly but since I'm working with C# I have to use late binding.

Thanks  

RE: MAS 200 BOI (Business Object Interface) Examples.

(OP)
I figured out... I'm posting the right code and it might help all the C# developers that are as confused as I'm with the MAS BOI:

 using (DispatchObject oARCustomerEntry = new DispatchObject(pvx.InvokeMethod("NewObject", "AR_Customer_bus", oSS.GetObject())))
                    {
                        try
                        {
                            object[] nextCustomerNumber = new object[] { "CustomerNo$" };

                            //Getting Next Customer Number
                            oARCustomerEntry.InvokeMethodByRef("nGetNextCustomerNo", nextCustomerNumber);

                            Console.WriteLine(nextCustomerNumber[0].ToString());

                            object retVal = 0;

                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetKeyValue", new object[] { "ARDivisionNo$", "60" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetKeyValue", new object[] { "CustomerNo$", nextCustomerNumber[0].ToString() });                           
                            retVal = oARCustomerEntry.InvokeMethod("nSetKey");

                            Console.WriteLine(retVal.ToString());

                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "CustomerName$", "ROSE DAWSON" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine1$", "1234 LONG DREAM ST" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine2$", "" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "AddressLine3$", "" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "City$", "CITRUS HEIGHTS" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "State$", "CA" });

                            Console.WriteLine(retVal.ToString());

                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "ZipCode$", "95621" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "CountryCode$", "USA" });
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "SalespersonDivisionNo$", "60" });                            
                            retVal = oARCustomerEntry.InvokeMethodByRef("nSetValue", new object[] { "SalespersonNo$", "RAP" });
                            Console.WriteLine(retVal.ToString());
                                                  
                            retVal = oARCustomerEntry.InvokeMethod("nWrite");

                            if (retVal.ToString() == "0")
                            {
                                object errorMsg = oARCustomerEntry.GetProperty("sLastErrorMsg");
                                Console.WriteLine(errorMsg.ToString());
                                Console.Read();
                            }

                            string customerNumber = nextCustomerNumber[0].ToString();

                            Console.WriteLine(retVal.ToString());

                            Console.Read();
                        }
                        catch (Exception ex)
                        {
                            object errorMsg = oARCustomerEntry.GetProperty("sLastErrorMsg");
                            Console.WriteLine(errorMsg.ToString());
                            Console.WriteLine(ex.Message);
                            Console.Read();
                        }
                        finally
                        {
                            oARCustomerObject.Dispose();
                        }
                    }

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close