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

Why Your Infor VISUAL Data Can’t Be Trusted (And How to Fix It)

Let’s start with something most teams won’t say out loud:If you’re running Infor VISUAL, there’s…

8 months ago

Not Using Your Infor VISUAL ERP to Its Full Potential? Here’s How to Unlock It

Many manufacturers invested in Infor VISUAL ERP years ago with the goal of improving visibility…

9 months ago

If You’re Still Manually Re-Entering Data Into Infor VISUAL, Read This

Let’s start with the honest truth.....If your team is still manually re-entering data into Infor…

9 months ago

Don’t Let the New Year Happen To Your ERP

A First-of-the-Year Reset for Infor VISUAL UsersThe start of a new year always brings momentum—new…

10 months ago