cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dim oPay As SAPbobsCOM.Payments

Dim iRetCode As Integer

with oPay

' add cashflow object

                            .CashAccount = cashaccount

                            .CashSum = cashsum

                            .PrimaryFormItems.AmountLC = yourcashsum

                            .PrimaryFormItems.CashFlowLineItemID = yourprimary

                            .PrimaryFormItems.CheckNumber = yourcheck

                            .PrimaryFormItems.PaymentMeans = PaymentMeansTypeEnum.pmtCash

End With

iRetCode = oPay.Add()

Answers (1)

Answers (1)

former_member183750
Active Contributor
0 Kudos

Hello Pringgo

I believe you have posted to an incorrect SCN Space. From the Overview for this Space:

SAP user community for SAP Crystal Reports, version for Visual Studio. Learn how to create & integrate Crystal reports into .NET applications and find the latest news, articles, tutorials, discussions, free downloads, blogs, sample apps, service packs and more.

You appear to be using Business One so the correct Space may be any one of the following:

SAP Business One - SAP Add-ons http://scn.sap.com/community/business-one/add-ons
SAP Business One Core http://scn.sap.com/community/business-one
SAP Business One E-Commerce and Web CRM http://scn.sap.com/community/business-one/add-ons
SAP Business One Integration Technology http://scn.sap.com/community/business-one-integration-technology
SAP Business One Partner Solutions (Add-ons) http://scn.sap.com/community/business-one/partner-solutions
SAP Business One Product Development Collaboration http://scn.sap.com/community/business-one-product-development-collaboration
SAP Business One Reporting & Printing http://scn.sap.com/community/business-one/reporting-and-printing
SAP Business One SDKhttp://scn.sap.com/community/business-one-sdk
SAP Business One System Administration http://scn.sap.com/community/business-one/system-administration

but see the Forum Finder for the New SCN. That should help.

- Ludek

SCN Moderator

Message was edited by: Ludek Uher

Former Member
0 Kudos

Thanks for your info