Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3323

How to Cancel A/P invoice through SDK

$
0
0

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 !!!!!


Viewing all articles
Browse latest Browse all 3323

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>