06-20-2017 8:05 AM - edited 02-03-2024 10:02 PM
Dear Sir,
I am trying to Update My Item With Di api in sap business one PL 08.
At time when i press button in which item update code is write it stop running.
please Help me regarding this.
Code:
SAPbobsCOM.Items oItem = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
oItem.GetByKey('ABC');
oItem.Excisable = SAPbobsCOM.BoYesNoEnum.tNO;
try
{
oItem.GSTRelevnt = SAPbobsCOM.BoYesNoEnum.tYES;
}
catch (Exception em1) { }
int k = oItem.Add(); if (k != 0)
{
/// ErrorMsg = ErrorMsg + "\r\n " + oCompany.GetLastErrorDescription();
}
Thnak and Regards
Veer Mistry
Hi Veer,
Below code is working for me:
SAPbobsCOM.Items oItem = (SAPbobsCOM.Items)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oItems);
oItem.GetByKey("TEST");
try
{
oItem.GSTRelevnt = SAPbobsCOM.BoYesNoEnum.tYES;
oItem.GSTTaxCategory = SAPbobsCOM.GSTTaxCategoryEnum.gtc_Regular;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
finally
{
int UP = oItem.Update();
if (UP != 0)
{
MessageBox.Show(oCompany.GetLastErrorDescription());
}
}
Put your item ABC under double quotes "ABC" . Also try to debug your code and tell us on which line does it give you the error.
Kind regards,
ANKIT CHAUHAN
SAP SME Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sir,
Thank you for replay.
This code is work when i used SAPbobsCOM Library but when i used SAPBusinessOneSDK library its stop my add on.
Thnaks and Regards,
Veer Mistry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Veer,
Surely, you are referring to the old SAPbobsCOM references. Check this link to verify whether you are having the same case:
Kind regards,
ANKIT CHAUHAN
SAP SME Support
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
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.