Skip to Content
0
Former Member
Apr 17, 2013 at 03:58 AM

[Help] How To Get CashFlow(primary form item) Object In B1?

306 Views

dear experts,

I created add on for payment checklist, and i have successfully get the outgoing payment object. but i have one big problem, i cannot get the object for Cash flow. please help me how to catch that object and include it on my add on..

here is my code to get the payment object, it's work, but i confused how to get cashflow object? please help...

oPay = B1Connections.diCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oVendorPayments)

For j = 1 To matrix0.RowCount cardcode = matrix0.Columns.Item("CC").Cells.Item(j).Specific.value cardname = matrix0.Columns.Item("CN").Cells.Item(j).Specific.value cashaccount = matrix0.Columns.Item("AT").Cells.Item(j).Specific.value cashsum = matrix0.Columns.Item("ST").Cells.Item(j).Specific.value InvNumber = matrix0.Columns.Item("DE").Cells.Item(j).Specific.value InvSum = matrix0.Columns.Item("ST").Cells.Item(j).Specific.Value

With oPay ' Bussiness Partner .DocType = SAPbobsCOM.BoRcptTypes.rSupplier .CardCode = cardcode .CardName = cardname

' Document Summary .DocDate = Date.Now .TaxDate = Date.Now .LocalCurrency = SAPbobsCOM.BoYesNoEnum.tYES .Remarks = remarks

If Left(matrix0.Columns.Item("AN").Cells.Item(j).Specific.value, 4) = "Kas " Then ' Cash .CashAccount = cashaccount .CashSum = cashsum Else ' Bank .TransferAccount = cashaccount .TransferSum = cashsum End If

'Invoices() .Invoices.DocEntry = InvNumber .Invoices.SumApplied = InvSum .Invoices.InvoiceType = SAPbobsCOM.BoRcptInvTypes.it_PurchaseInvoice .Invoices.Add() End With

iRetCode = oPay.Add() If iRetCode = 0 Then ' Update Status Dim sql As String sql = "Update [dbo].[@IDU_PAYMENT_DET] SET U_Status='Closed' WHERE U_BaseEntr='" & matrix0.Columns.Item("DE").Cells.Item(j).Specific.VALUE & "'" IDU._executeQuery(sql)

Dim sql2 As String sql2 = "Update [dbo].[@IDU_PAYMENT_HDR] SET Status='C' WHERE DocEntry='" & form.Items.Item("3").Specific.VALUE & "'" IDU._executeQuery(sql2) Else B1Connections.diCompany.GetLastError(iRetCode, serrmsg) B1Connections.theAppl.MessageBox(serrmsg) Return False End If Next