Setting Ship Date when Shipped checkbox is clicked

We have a great customized version of the Pack Slip entry form which we use to create a Certificate of Compliance (which is really just a Pack Slip), which can then be loaded up in Customer Shipment Entry where the Pack Slip can be printed and shipped. However, the Certificate might get generated a day before it’s actually shipped, so when they go to ship it, they have to check and make sure to update the ship date before checking the Shipped checkbox.

I wrote a pre-processing Method Directive that fires on the CustShip BO and the CheckReadyToInvoice Method…but I get an error about not being able to update the ship date when I click the Shipped checkbox. I thought that since this was a pre-processing directive it would change the TT.ShipDate before the field goes read only.

Our Cof C is also in our packslip. I set fields in Post processing of FreightService.UpdateFreightedShipment which for us is just before checking shipped.

I added ShipHead.ShipDate to that and it seems to work.

@fredmeissner

We also generate the shipping documentation and CofC upfront.

We approached the problem in a slightly different manner and hooked the Ship Date update on the back of the GetByID method.

In my opinion and our business scenario the Ship Date is relatively meaningless until the product is actually marked shipped .

Just a suggestion.

Alternatively… depending on what version of Epicor your on, I’ve seen people create the pack slip with and null date, thereafter when you mark it as shipped it automatically applies the current date without any coding / BPMs.

Hope this helps

1 Like

I am not using a bpm. I coded directly in the form the detection of the check change.

in init:
chkShipped = (EpiCheckBox)csm.GetNativeControlReference("ba9047e9-9155-4ffd-844a-1ea9775eab42");

private void chkShipped_CheckedChanged(object sender, System.EventArgs e)
	{
		if(chkShipped.Checked && (bool)chkShipped.CheckedValue == true && ShipHead_Row.CurrentDataRow != null && (bool)ShipHead_Row.CurrentDataRow["ReadyToInvoice"] == false)				
		{
							
				
			var now = DateTime.Now.Date;
			var shp = (DateTime)ShipHead_Row.CurrentDataRow["ShipDate"];
			bDateOK = true;
			if(shp != now && MessageBox.Show(CustShipForm, "La date du connaisement n'est pas celle d'aujourd'hui." + Environment.NewLine + "Désirez-vous changer la date d'expédition?", "Validation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
			{
				chkShipped.Checked = false;
				edtShipDate.Focus();
				edtShipDate.DropDown();
				bDateOK = false;
			}
			else
				bDateOK = true;//only check once...

			
		}





	}
1 Like

Thank you everybody, I’m going to go with the GetByID method. Works great!

I tried using the CustShip.GetByID and it wasn’t working with the condition of ReadyToInvoice from false to true. I also tried post-processing on CustShip.Update. How did you use the GetByID method?

  1. Set Up in Pre-Processing Get By ID

  2. Post Processing -

1st condition = This directive has been enabled from … directive.

1 Like