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

Salesforce Integration Consulting And Solution Options

Salesforce integration consulting is about more than just finding a partner with experience in integrations.…

2 months ago

Hand-Picked Digital Marketing Platforms for Manufacturers

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

2 months ago

2024 Manufacturing Trends

Don’t be left behind by neglecting these 2024 manufacturing trends.

3 months ago

Maximizing ROI with CloudSuite Industrial

With a comprehensive ERP like CloudSuite Industrial (CSI) from Infor, there are countless possibilities for…

4 months ago

Infor ERP Releases Innovative Features

An Infor ERP solution isn’t just a temporary fix to today’s issues, it’s an investment…

4 months ago

Infor ERP Integrations

An Infor ERP can dramatically improve your operations, but with an ERP integration, you can…

4 months ago