- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
C# nGetValue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-16-2012 12:40 PM
for some reason mu nGetValuie is returning blank, any idea?
public List<Ingredient> GetIngredientsFromMAS90()
{
List<Ingredient> lstIngredient = new List<Ingredient>(); //Here we create a list object of Employee type
// write the logic to retrive the ingredients from MAS90 here
// once getting data, as per the count of the ingredients downloaded from MAS90, loop throught the ingredients and construct a generic collection(i.e, list of ingredients)
//start of code
using (DispatchObject pvx = new DispatchObject("ProvideX.Script"))
{
// Replace the text "*PATH TO MAS90\HOME*" with the correct MAS90\Home path in the line below
pvx.InvokeMethod("Init", @"D:\sage\DRG_440_MD\MAS90\Home");
// 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")))
{
oSS.InvokeMethod("nSetUser", "developer","");
oSS.InvokeMethod("nSetCompany", "011");
oSS.InvokeMethod("nSetDate", "C/I", DateTime.Now.ToString("yyyyMMdd"));
oSS.InvokeMethod("nSetModule", "C/I");
int TaskID = (int)oSS.InvokeMethod("nLookupTask", "CI_ItemCode_ui");
oSS.InvokeMethod("nSetProgram", TaskID);
Object xMessage ;
string xItemCode = "";
string xItemCodeDesc = "";
string xSearch = "";
int retval = 0;
string r=null, i=null;
using (DispatchObject oXX = new DispatchObject(pvx.InvokeMethod("NewObject", "CI_ItemCode_bus", oSS.GetObject())))
{
object[] getResultSetParams = new object[] { "ItemCode$", "ItemCodeDesc$", "", "", "ItemType$ ="+(char)34+"1"+(char)34, "", "" };
oXX.InvokeMethodByRef("nGetResultSets",getResultSe
string [] names = getResultSetParams[2].ToString().Split(System.Conv
for (int x = 1; x < names.Length - 1; x++)
{
xSearch = names[x];
retval = (int) oXX.InvokeMethod("nFind",xSearch);
retval = (int)oXX.InvokeMethod("nGetRecord");
retval = (int) oXX.InvokeMethod("nGetValue","ItemCode$",xItemCode
retval = (int) oXX.InvokeMethod("nGetValue", "ItemCodeDesc$", xItemCodeDesc);
System.Console.WriteLine("Name Item " + x.ToString() + " : " + xItemCode + " [" +xItemCodeDesc + "]");
}
}
}
}
System.Console.WriteLine("End");
// end of code
//fill the number of ingredients count in a variable
/*
int countIngredients=0;
for (int index = 0; index < countIngredients; index++)
{
Ingredient oIngredient = new Ingredient();
// Prepare the Ingredients data like below
// oIngredient.Id = "Ingredient Id";
// oIngredient.Name = "Ingredient Name";
// etc..,
lstIngredient.Add(oIngredient);
}
*/
return lstIngredient;
}
Re: C# nGetValue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-16-2012 01:01 PM
Re: C# nGetValue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-25-2012 10:23 AM
Look at the solution in this post.
http://community.sagemas.com/t5/Business-Object-In
Sr. Software Engineer
Sage 100 ERP
Re: C# nGetValue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-08-2012 01:01 AM
Hi, Im new in development with BOI by .net (C#). Could you please tell me or share me sample code about it.
Follow your topic, I can't find any DispatchObject class (reference). How can you do that? ![]()
Re: C# nGetValue
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-22-2012 06:48 AM
Hi zbillg.
I searched this class too and I find it here:
http://community.sagemas.com/t5/Business-Object-In


