Extract data of Outstanding Purchase Order with API
The sample code below shows how to retrieve the DataSet of Outstanding Purchase Order.
This sample does not filter the result.
publicSystem.Data.DataSetOutstandingPurchaseOrderData(BCE.Data.DBSettingdbSetting){//Create the object of PurchaseOrdersOutstandingReportCommandBCE.AutoCount.Invoicing.Purchase.PurchaseOrder.PurchaseOrderOutstandingReportCommandrptCmd=BCE.AutoCount.Invoicing.Purchase.PurchaseOrder.PurchaseOrderOutstandingReportCommand.Create(dbSetting);//Prepare the DataSet of Master table and Detail tableSystem.Data.DataTabledtMaster=newSystem.Data.DataTable("Master");System.Data.DataTabledtDetail=newSystem.Data.DataTable("Detail");System.Data.DataSetdsOutstandingPO=newSystem.Data.DataSet();dsOutstandingPO.Tables.Add(dtMaster);dsOutstandingPO.Tables.Add(dtDetail);//Add the criterias that require to retrieve the data//Such as add filter to resultBCE.AutoCount.Invoicing.Purchase.PurchaseOrder.PurchaseOrderOutStandingReportingCriteriacrit=newBCE.AutoCount.Invoicing.Purchase.PurchaseOrder.PurchaseOrderOutStandingReportingCriteria();//Define addition fields of DocNo, DocDate, CreditorCode, CreditorName.//Programmer may add more fieldname to the DataTable of Master Table. rptCmd.BasicSearch(crit,"DocNo,DocDate,CreditorCode,CreditorName",dsOutstandingPO,"");//Create a new DataRelation to Master and Detail tables in dsOutstandingPOdsOutstandingPO.Relations.Add("MasterDetailRelation",dtMaster.Columns["DocKey"],dtDetail.Columns["DocKey"],false);returndsOutstandingPO;}