cancel
Showing results for 
Search instead for 
Did you mean: 

Incoming Payment error

Former Member
0 Kudos

Hi, everyone

I was trying to create incoming payment with DI API.

Credit card payment works fine.

But cash and checks payments failed with 'General observer error" message.

I could create cash or checks payment thru Business One.

I'm running B1 2005 SP01 PL12

This is DI API Code.

oRecordSet = oRecordSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)

SqlStr = "Select * FROM SMST3_RCPT WHERE T3_SynchFlag = 0 "

rs = ADOcon.Execute(SqlStr)

While Not rs.EOF

vDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oIncomingPayments)

vDoc.CardCode = rs.Fields.Item("T3_CardCode").Value

'vDoc.CardName = rs.Fields.Item("T3_CardName").Value

vDoc.CounterReference = Convert.ToString(rs.Fields.Item("T3_DocRef").Value)

vDoc.DocDate = Now

vDoc.DocCurrency = "VUV"

Select Case rs.Fields.Item("T3_PayType").Value

Case 1 '-- Cash

vDoc.CashSum = rs.Fields.Item("T3_CashAmt").Value

Case 2 '-- Cheque

vDoc.Checks.DueDate = Now

vDoc.Checks.CountryCode = "VU"

vDoc.Checks.CheckNumber = rs.Fields.Item("T3_ChqNum").Value

vDoc.Checks.CheckSum = rs.Fields.Item("T3_ChqAmt").Value

'vDoc.Checks.Trnsfrable = SAPbobsCOM.BoYesNoEnum.tNO

Case 3 '-- Credit

ValidDate = "01/" & rs.Fields.Item("T3_ExpiryDate").Value

ValidDate = ValidDate.AddMonths(1)

ValidDate = ValidDate.AddDays(-1)

vDoc.CreditCards.CreditCardNumber = Replace(rs.Fields.Item("T3_CardNum").Value, " ", "")

vDoc.CreditCards.CreditCard = 1

vDoc.CreditCards.CardValidUntil = ValidDate

vDoc.CreditCards.CreditSum = rs.Fields.Item("T3_CreditAmt").Value

vDoc.CreditCards.VoucherNum = "11"

End Select

vDoc.UserFields.Fields.Item("U_LocalCd").Value = Convert.ToString(rs.Fields.Item("T3_LocalCd").Value)

lRetCode = vDoc.Add()

If lRetCode = 0 Then

Else

oCompany.GetLastError(lRetCode, sErrMsg)

End If

vDoc = Nothing

rs.MoveNext()

End While

I hope someone can help me.

Thanks

Message was edited by:

Joanne Lee

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello anyone,

Any tips will do as long as i can be pointed to the direction where will i start my configuration tracing.

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Joanne,

When you install PL 12, did you uninstall the DI API via the Windows Add/Remove Programs and then re-install the DI API?

Eddy

Former Member
0 Kudos

Hi Edward,

I re-installed the DI API for PL12 when I upgraded B1

I've solved this issue.

B1 crashed when I created incoming payment by cash without selecting invoice if I set value to under/overpayment Amt Allowed on Document Settings-Incoming Payment form.

I could create cash payment after I set no value on this column.

I think this is a B1 bug.

Thank you

Former Member
0 Kudos

Hello Joanne,

How did you solved this?

I just had this error. The system crashes when i try to add a cash payment invoice via DI API.

My code works just fine in one company but it just failed in the other. The only difference i know for the two companies is that the second company uses a segmented Account Code for its Chart of Accounts.

The companies are implemented by different person that maybe there is a configuration missing in the second company which i do not know since the system crashes without any error message.

I cannot get what you did in your last post. Please help me or anyone in this forum for any inputs

Thank you