Skip to Content
0
Former Member
Jul 15, 2005 at 04:11 PM

Problem Adding BOM using Product Trees Object

99 Views

Hey I am having problems with the following code:

qProductTree = (SAPbobsCOM.ProductTrees)this.m_SboAddon.SboCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oProductTrees);

int RetVal = 0;
qProductTree.TreeCode = "productTree1";
qProductTree.TreeType = SAPbobsCOM.BoItemTreeTypes.iProductionTree;
qProductTree.Quantity  = 5;
qProductTree.Items.ItemCode = "test1";
qProductTree.Items.Price = 20;
qProductTree.Items.Quantity = 1;
qProductTree.Items.Currency = "Eur";
qProductTree.Items.Comment = "test comment";
qProductTree.Items.IssueMethod = SAPbobsCOM.BoIssueMethod.im_Manual;
	
RetVal = qProductTree.Add();

string errMsg;
int errCode;
if (RetVal != 0 )
{
     this.m_SboAddon.SboCompany.GetLastError(out errCode, out errMsg);
	MessageBox.Show(errMsg);
}

I get an error message with ID 2028 which when I look it up in the SDK it states DataSource - No Data found.

Any ideas?