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

Infor CSI Syteline – Paste Rows Append for Data Load

Entering Records individually into CSI will ensure that the required data is filled out for…

2 months ago

Infor VISUAL ERP: How to Future-Proof Your Manufacturing Operations

For decades, Infor VISUAL ERP has been the backbone of countless manufacturers. Its strength lies…

3 months ago

Infor CloudSuite Industrial: Features & Options

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

8 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…

8 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…

10 months ago

Hand-Picked Digital Marketing Platforms for Manufacturers

Platform: HubSpot Where It Shines: Email marketing - easy to use email lists, automation, and…

2 years ago