on 10-16-2015 1:28 PM
Hi,
I am trying to create a Journal Entry through SAP B1 DI API in ASP.Net using C#. In the form, I have a button. I have written the code for creating a Journal Entry to the OnClick event of that button. The required field Value (for objects) I have passed for both header level as well as Line Level.
But I am getting the error code (- 4006) where the Description is "update exchange rates".
I am sharing the Code here for better understanding.
SAPbobsCOM.Company ocompany = new SAPbobsCOM.Company();
if (sapcon.ConnectSAPCompany(ref ocompany) == true)
{
try
{
SAPbobsCOM.JournalEntries vJE = (SAPbobsCOM.JournalEntries)ocompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oJournalEntries);
sap_connection objSessionHelper = new sap_connection();
vJE.ReferenceDate = new DateTime(2015, 10, 25);
vJE.DueDate = new DateTime(2015, 10, 25);
vJE.TaxDate = new DateTime(2015, 10, 25);
vJE.Memo = "Test Message";
vJE.TransactionCode = "INR";
vJE.Lines.BPLID = 235;
vJE.Lines.Credit = 3000;
vJE.Lines.Debit = 0;
vJE.Lines.Add();
vJE.Lines.AccountCode = "700040";
vJE.Lines.Credit = 0;
vJE.Lines.Debit = 3000;
vJE.Lines.Add();
int i = vJE.Add();
if (i == 0)
{
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Journal Entry Created Successfully');", true);
return;
}
else
{
string des = ocompany.GetLastErrorDescription();
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + des.ToString() + "');", true);
}
}
catch (Exception ex)
{
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + ex.ToString() + "');", true);
}
}
Any help is
Update your exchange rate base for this date: 2015, 10, 25
Administration Exchange Rates and Indexes
Regards,
Bry
Blog: Tips and Tricks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.