Skip to Content
0
Sep 04, 2020 at 08:26 AM

Expand Matrix Tree programmatically SAP Business One

64 Views

Hello all,

Please tell me how to expand Matrix through SDK. I need to read all data inside in one of the matrixes in Payment Wizard. Thank you in advance! I have 9 steps there which present the diferrent panel levels.

else if (paymentWizard.PaneLevel == 5 && pVal.ItemUID == "4") { SAPbouiCOM.Matrix oVendorMatrix = (SAPbouiCOM.Matrix)paymentWizard.Items.Item("62").Specific; if (oVendorMatrix.VisualRowCount > 0) { List<Vendor> vendors = new List<Vendor>(); string oldVendorCode = ""; Vendor vendor = new Vendor(); for (var zz = 1; zz <= oVendorMatrix.VisualRowCount; zz++) { bool selectedRowVendorOrInvoice = (oVendorMatrix.Columns.Item("1").Cells.Item(zz).Specific as SAPbouiCOM.CheckBox).Checked; if (selectedRowVendorOrInvoice) { //this is the business partner order var number = (oVendorMatrix.Columns.Item("11").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value; if (!string.IsNullOrEmpty(number)) { vendor = new Vendor(); //this the business partner code vendor.Code = (oVendorMatrix.Columns.Item("10").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value; if (!string.IsNullOrEmpty((oVendorMatrix.Columns.Item("10").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value)) { oldVendorCode = vendor.Code; } SAPbobsCOM.BusinessPartners businessPartner = (SAPbobsCOM.BusinessPartners)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners); businessPartner.GetByKey(vendor.Code); vendor.BankAccount = businessPartner.BPBankAccounts.IBAN; vendor.BIC = businessPartner.BPBankAccounts.BICSwiftCode; vendor.PaymentMethod = businessPartner.BPPaymentMethods.PaymentMethodCode; vendor.TotalAmount = (oVendorMatrix.Columns.Item("1250000138").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value.Replace("BGN ", ""); vendors.Add(vendor); } else { string invoiceNumber = (oVendorMatrix.Columns.Item("52").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value; string invoiceAmount = (oVendorMatrix.Columns.Item("53").Cells.Item(zz).Specific as SAPbouiCOM.EditText).Value; if (!string.IsNullOrEmpty(invoiceNumber) && number == "") { Vendor verdorBefore = vendors.FirstOrDefault(x => x.Code == oldVendor); if (verdorBefore != null) { Invoice invoice = new Invoice(); invoice.Number = invoiceNumber; invoice.Amount = invoiceAmount.Replace("BGN ", ""); if (verdorBefore.InvoiceList == null) { verdorBefore.InvoiceList = new List<Invoice>(); } verdorBefore.InvoiceList.Add(invoice); } } } } } } }