Showing results for 
Search instead for 
Did you mean: 


Former Member
0 Kudos


The following journalEntry code giveing an error, while running the programm. The error is "Exchange rate not updated". how can i rectify this error.


Dim vJE As SAPbobsCOM.JournalEntries

Set vJE = vCompany.GetBusinessObject(oJournalEntries)

vJE.TaxDate = Now

vJE.Lines.AccountCode = "110000"

vJE.Lines.ContraAccount = "10110"

vJE.Lines.Credit = 0

vJE.Lines.Debit = 150

vJE.Lines.DueDate = CDate("11/13/ 2002")

'vJE.Lines.Line_ID = "0"

vJE.Lines.ReferenceDate1 = Now

vJE.Lines.ShortName = "110000"

vJE.Lines.TaxDate = Now

Call vJE.Lines.Add

Call vJE.Lines.SetCurrentLine(0)

vJE.Lines.AccountCode = "10110"

vJE.Lines.ContraAccount = "110000"

vJE.Lines.Credit = 150

vJE.Lines.Debit = 0

vJE.Lines.DueDate = CDate("11/13/ 2002")

'vJE.Lines.Line_ID = 1

vJE.Lines.ReferenceDate1 = Now

vJE.Lines.ShortName = "10110"

vJE.Lines.TaxDate = Now

View Entire Topic
0 Kudos

Hi Satish,

When you use SAP B1 application and you want to create a document you have first to set an Exchange Rate for different currencies in the system. This window will be automatically promted in case this field for a particular date is not updated. This is why you are getting this error message, as the DI API executes the same checks as B1. You have to indicate this exchange rate.

Check the info of the DocRate property of the documents object:

DocRate PropertyDescription

Returns or sets a double integer that specifies the exchange rate with local currency for the document.

Property type

Read-write property

Syntax (Visual Basic)

Public Property DocRate() As Double


Not relevant for documents that use local currency.

If the document does not use local currency, you must specify an exchange rate for this document. To get a recommended exchange rate, use the GetCurrencyRate method.

This property is not relevant for oInventoryGenEntry and oInventoryGenExit document types.

See Also

Documents Object

Also useful to retreive this information is method GetCurrencyRate of the SBObob object. For futher info regarding this object you can refer to the SDK Help Center. Additionally you can find code under the folder "C:\Program Files\SAP Manage\SAP Business One SDK\Samples\COM DI\VB.NET\03.UsingSBObob\2003"

Hope this info helps,