One Click Shipment in Epicor® 9.05

We have a customer that wanted to ship items directly from the sales order without having to go through the shipment entry screen. The orders never change and the items are non-stock so they don’t need the functionality provided by that screen.

To streamline this process we created a button on the sales order entry screen that will automatically ship the order, it mimics the mass shipment functionality from the Shipment Entry screen. Below is the source code you can call from a button click event.

Ship Order Sample

Here is the source.

        private static void ShipSalesOrderMethod()
        {

// Declare and Initialize EpiDataView Variables
EpiDataView edvOrderHed = ((EpiDataView)(oTrans.EpiDataViews[“OrderHed”]));
Epicor.Mfg.Core.Session session = (Epicor.Mfg.Core.Session)SalesOrderForm.Session;

Epicor.Mfg.BO.CustShipDataSet dsCustShip = new Epicor.Mfg.BO.CustShipDataSet();
Epicor.Mfg.BO.PackOutDataSet dsPackOut = new Epicor.Mfg.BO.PackOutDataSet();
System.String warnMsg = “”;
System.String creditMsg = “”;

// Check if valid EpiDataView Row(s) are selected
if ((edvOrderHed.Row < 0))
{
MessageBox.Show(“No Order Selected”);
return;
}

int salesOrder = ((int)(edvOrderHed.dataView[edvOrderHed.Row][“OrderNum”]));

Epicor.Mfg.BO.CustShip custShip = new Epicor.Mfg.BO.CustShip(session.ConnectionPool);
custShip.GetNewShipHead(dsCustShip);
try
{
custShip.GetHeadOrderInfo(salesOrder, out creditMsg, dsCustShip);
if (!””.Equals(creditMsg))
{
MessageBox.Show(creditMsg);
}
System.String shipToCustomerList = “”;
custShip.BuildShipToCustomerList(salesOrder, out shipToCustomerList);

custShip.BuildShipToList(salesOrder, 9, out shipToCustomerList);

custShip.Update(dsCustShip);

dsPackOut = custShip.POGetNew(salesOrder, dsCustShip.ShipHead[0].PackNum, out warnMsg);
dsPackOut = custShip.POGetDtlList(dsCustShip.ShipHead[0].PackNum, salesOrder, “PACK”, out warnMsg);

custShip.PreCreateMassShipDtl(dsCustShip.ShipHead[0].PackNum, salesOrder, out warnMsg, dsCustShip);
custShip.CreateMassShipDtl(dsCustShip.ShipHead[0].PackNum, salesOrder, dsCustShip);

MessageBox.Show(“” + dsCustShip.ShipHead[0].PackNum);
custShip.MarkShipmentLines(dsCustShip);
custShip.Update(dsCustShip);

System.Boolean compliant;

dsCustShip.ShipHead[0].ReadyToInvoice = true;

if (!””.Equals(creditMsg))
{
MessageBox.Show(warnMsg);
}

custShip.Update(dsCustShip);
custShip.PostUpdate(dsCustShip.ShipHead[0].PackNum, out warnMsg);
if (!””.Equals(creditMsg))
{
MessageBox.Show(warnMsg);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}

MessageBox.Show(“Done”);

}

Suggested

Becky Lipnick

Recent Posts

Maximize Your ROI with Infor VISUAL Integrations​

Infor VISUAL ERP is a go-to choice for manufacturers who need a production-centric system that…

3 months ago

Infor CloudSuite Industrial: Features & Options

Infor CSI (Syteline) - Features & Options With the creation of Infor Configure Price Quote…

5 months ago

Infor CSI: Excel Report Output Format for Reports Without a Dataview

Infor CloudSuite Industrial (CSI) provides powerful reporting capabilities, often leveraging Dataviews for easy extraction of…

5 months ago

How Datix can help Support your Infor VISUAL ERP Platform

In today’s fast-paced manufacturing environment, efficiency, accuracy, and scalability are critical for business success. Infor…

8 months ago

Custom Integrations Disguised As IPAAS Solutions

Many software integrations are build on IPAAS (Integration Platform As A Service) technology because an…

9 months ago