Hi everyone,
I would like to customize a button on Receipt Entry From that will automatically generate the Packing slip number.
I did bind the function below to a button to create automatically new number.
There is a sample code on the Internet looks like as below:
My question is 3 first lines of the code which is included the outdated-library. How could I replace it with the new library on Epicor version 10.2.700
I really appreciate your help.
#Here is the sample code
private static void GetNextPackSlip()
{
Epicor.Mfg.Core.Session session = (Epicor.Mfg.Core.Session)ReceiptEntryForm.Session;
Epicor.Mfg.BO.Company company = new Epicor.Mfg.BO.Company(session.ConnectionPool);
Epicor.Mfg.BO.CompanyDataSet dsCompany = new Epicor.Mfg.BO.CompanyDataSet();
dsCompany = company.GetByID("EPIC03");
//We are storying the current pack slip number in Number01 field in the company table
decimal number = dsCompany.Company[0].Number01;
//Make sure we have data loaded into the Receive Header data view.
if(edvRcvHead.dataView.Count > 0) {
edvRcvHead.dataView[0]["PackSlip"] = "PACK" + number;
MultiKeySearch_Row.dataView[0]["PackSlip"] = "PACK" + number;
//Increment the stored number
dsCompany.Company[0].Number01 = number + 1;
//Update the company table.
company.Update(dsCompany);
} else {
MessageBox.Show("Please create a new receipt first.");
}
}