Hi,
i want to cancel my A/P invoice through DI API but they give Error- 'The requested action is not supported for this object.'
My Code is given Below-
int DocEntry =ldna_Rec1.Fields.Item("DocEntry").Value; | |
SAPbobsCOM.Documents oInvoice; | |
oInvoice = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseInvoices); | |
oInvoice.GetByKey(DocEntry); | |
if (oInvoice.Cancel() == 0) | |
{ | |
clsAddOn.LDNA_Application.StatusBar.SetText(DocEntry + " Record Cancelled Sucessfully from " + PeriodName, SAPbouiCOM.BoMessageTime.bmt_Short, SAPbouiCOM.BoStatusBarMessageType.smt_Success); | |
} | |
else | |
{ | |
BubbleEvent = false; | |
clsAddOn.LDNA_Application.StatusBar.SetText(clsAddOn.LDNA_Company.GetLastErrorDescription(), SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Error); | |
return; | |
} |
i want to cancel the AP invoice through Sdk Code.
Please give me solution for above code.
Thanks !!!!!