Solved

Pick Pack and Ship Screen


Userlevel 2
Badge

If I want to add new DB fields on this screen, which table they will be added I know its ScanHeader DACExtension but I am not able to find the respective table. I need to add details like on which day this shipment was scanned it was scanned by whom and data like that. 

icon

Best answer by Naveen Boga 21 June 2022, 08:01

View original

23 replies

Userlevel 6
Badge +5

The main view is a virtual DAC so there is no database table. If you are looking to persist information like that you would probably want to do so on the Shipment record. 

Userlevel 2
Badge

@markusray17 by Shipment table are you suggesting SOShipment table ??

If that's the case how can I add those field in that table via ScanHeader DACExtension. Or there is some other way to do this.

Userlevel 2
Badge

 

@markusray17 by Shipment table are you suggesting SOShipment table ??

If that's the case how can I add those field in that table via ScanHeader DACExtension. Or there is some other way to do this.

Anyone knows how to do this then please reply.

 

Userlevel 6
Badge +5

You would add them to SOShipment DAC via a cache extension(and the SOShipment table). I’m not sure what the ScanHeader DAC has to do with this but I may just be on a different version(21R2) than you. On mine the graph is PickPackShipHost for that page and the primary view uses the WMSHeader DAC.

Userlevel 7
Badge +5

What’s the screen ID that you’re wanting to modify?

Userlevel 2
Badge

@ddunn @markusray17 I am trying to add those fields in screen-id SO302020.

I am using version (22R1).

Gaph for me is PX.Objects.SO.WMS.PickPackShip.Host

 

 

Userlevel 7
Badge +17

Hi, @param2022  Pick Pack and Ship screen, is where we can enter a few details to scan the shipments one by one.

But why do you want to add the DATABASE fields? Can you please explain the business scenario for this? which will help us to provide a proper solution.

Userlevel 2
Badge

@Naveen Boga  I need to add details like on which day I want to add this fields in relation to shipment. Like who was the picker need to add name and Id for that person. Then I need to add that info to shipping screen.

Userlevel 7
Badge +17

@param2022  I have very limited knowledge on the Pick Pack and Ship screen but for this requirement, you can do like below and hope it would help.

  1. In the Pick Pack, and Header, you can create 2 Unbound fields (Picker and Date)
  2. As soon as we scan the shipment, make sure these 2 fields should be populated automatically.
  3. And create the same fields in SOShipment DAC with database fields
  4. In the Pick Pack and Ship screen, while performing any action you can override and pass these fields to SOShipment DAC and SAVE the field.

 

Userlevel 2
Badge

@Naveen Boga that seems doable but I am getting shipment object null in the graph extension.

My code 

 

SOShipment shipment = Base.WMS.Shipment;
SOShipmentExt shipmentExt = shipment.GetExtension<SOShipmentExt>();

 

Userlevel 2
Badge

@Naveen Boga @ddunn @markusray17 

I am facing issue in accessing SOShipment record in the Host graph for PickPackShip screen.
Every time a value is entered in the Scan field the field updated event is called. And it might not be shipment number every time. It might be a item code also or a command. So i need ShipmentNumber in every event call. How can we access that anyone have any idea ? 

Userlevel 6
Badge +5

You can store the shipment record in the cache when it is scanned. I would expect the graph already does that though so you may want to look at the views/caches and see if it is storing the shipment record somewhere after being scanned. I believe the Host graph inherits from SOShipmentEntry so you could also use the views/cache from that graph if necessary. 

Userlevel 2
Badge

@Naveen Boga @ddunn @markusray17 

I have tried getting the SOShipment in various ways through base but all the time value is null.

PXCache<SOShipment> shipmentTemp = new PXCache<SOShipment>(Base);

var shipment = Base.WMS.Shipment;

Can’t get the value by any of this. 

Userlevel 7
Badge +17

Hi @param2022  Can you please share your complete Graph file source code here. I will check from my end.

Userlevel 2
Badge

@Naveen Boga here is my graph file code. I am trying to do this in ScanHeader_Barcode_FieldUpdated method. I need to take values from HeaderExt, find SOShipment record in DB fetch it and update that record.

using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using PX.SM;
using PX.Common;
using PX.BarcodeProcessing;
using PX.Data;
using PX.Data.BQL;
using PX.Data.BQL.Fluent;
using PX.Objects.Common;
using PX.Objects.Common.Extensions;
using PX.Objects.Extensions;
using PX.Objects.AR;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.IN.WMS;
using WMSBase = PX.Objects.IN.WMS.WarehouseManagementSystem<PX.Objects.SO.WMS.PickPackShip, PX.Objects.SO.WMS.PickPackShip.Host>;
using PX.Objects;
using PX.Objects.SO.WMS;
using Demo_Code.DAC_Extentions;
using PX.Objects.EP;
using Demo_Code.Helpers;

namespace PX.Objects.SO.WMS
{
// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class PickPackShip_Extension : PXGraphExtension<PX.Objects.SO.WMS.PickPackShip.Host>
{
#region Event Handlers

protected void ScanHeader_Picker_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
try
{
ScanHeader row = (ScanHeader)e.Row;
HeaderExt headerExt = row.GetExtension<HeaderExt>();
PickPackShip.Host graph = PXGraph.CreateInstance<PickPackShip.Host>();
var employees = from p in graph.Select<EPEmployee>()
where
p.BAccountID.Value == headerExt.Picker
select new
{
p.AcctName
};
headerExt.PickerName = employees.FirstOrDefault()?.AcctName;
}
catch (Exception ex)
{
throw;
}
}

protected void ScanHeader_Barcode_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
{
ScanHeader row = (ScanHeader)e.Row;
HeaderExt headerExt = row.GetExtension<HeaderExt>();
if (headerExt.Picker == null || headerExt.PickerName == null)
{
throw new PXSetPropertyException(CustomMessages.PickerNotSelectedMsg);
}
}

protected void ScanHeader_Barcode_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PXCache<SOShipment> shipmentTemp = new PXCache<SOShipment>(Base);
IEnumerable<SOShipmentEntry> temp = cache.Cached.Cast<SOShipmentEntry>();
ScanHeader row = (ScanHeader)e.Row;
HeaderExt headerExt = row.GetExtension<HeaderExt>();
PickPackShip.Host graph = PXGraph.CreateInstance<PickPackShip.Host>();
switch (row.ScanState)
{
case "ITEM":
headerExt.ScanningStatus = "Partial";
break;
case "NONE":
headerExt.ScanningStatus = "Completed";
break;
default:
break;
}

SOShipment shipment = (from p in graph.Select<SOShipment>()
where
p.ShipmentNbr == row.Barcode
select p).FirstOrDefault();
if (shipment != null)
{
SOShipmentExt shipmentExt = shipment.GetExtension<SOShipmentExt>();
cache.SetValueExt<SOShipmentExt.usrScanner>(shipment, headerExt.Scanner);
cache.SetValueExt<SOShipmentExt.usrScannerName>(shipment, headerExt.ScannerName);
cache.SetValueExt<SOShipmentExt.usrPicker>(shipment, headerExt.Picker);
cache.SetValueExt<SOShipmentExt.usrPickerName>(shipment, headerExt.PickerName);
Base.Document.Update(shipment);
}
}

#endregion
}
}

 

Userlevel 2
Badge

@Naveen Boga did you get any breakthrough ?

Userlevel 7
Badge +17

Hi @param2022  Yes, I just modified the code and verified and it is working fine.

 

Please do modify your code accordingly and verify. 

 

    protected void ScanHeader_Barcode_FieldUpdated(PXCache cache, PXFieldUpdatedEventArgs e)
{
PXCache<SOShipment> shipmentTemp = new PXCache<SOShipment>(Base);
IEnumerable<SOShipmentEntry> temp = cache.Cached.Cast<SOShipmentEntry>();
ScanHeader row = (ScanHeader)e.Row;
HeaderExt headerExt = row.GetExtension<HeaderExt>();
PickPackShip.Host graph = PXGraph.CreateInstance<PickPackShip.Host>();
switch (row.ScanState)
{
case "ITEM":
headerExt.ScanningStatus = "Partial";
break;
case "NONE":
headerExt.ScanningStatus = "Completed";
break;
default:
break;
}

SOShipment shipment = (from p in graph.Select<SOShipment>()
where
p.ShipmentNbr == row.Barcode
select p).FirstOrDefault();
if (shipment != null)
{
SOShipmentEntry shipGraph = PXGraph.CreateInstance<SOShipmentEntry>();
SOShipmentExt shipmentExt = shipment.GetExtension<SOShipmentExt>();
//cache.SetValueExt<SOShipmentExt.usrScanner>(shipment, headerExt.Scanner);
//cache.SetValueExt<SOShipmentExt.usrScannerName>(shipment, headerExt.ScannerName);
shipGraph.Document.Cache.SetValueExt<SOShipmentExt.usrPicker>(shipment, headerExt.UsrPicker);
cache.SetValueExt<SOShipmentExt.usrPickerName>(shipment, headerExt.UsrPickerName);
shipGraph.Document.Update(shipment);
shipGraph.Save.Press();
}
}

 

Userlevel 2
Badge

@Naveen Boga is there any other change that I need to do ? Because I replaced the whole method with method that you provided and still all fields are null in my database.

Userlevel 7
Badge +17

@param2022  That is the only change I have done and it was working for me.

Can you please verify that are you getting the values in the below extension fields in  ScanHeader_Barcode_FieldUpdated?

  1. headerExt.UsrPickerName
  2. headerExt.UsrPicker
Userlevel 2
Badge

@Naveen Boga yes I am getting both of those field’s correct values in the method. I have debugged and check that.

Userlevel 7
Badge +17

@param2022  Hoping that you have written the bound DAC fields in the SOShipment extension DAC but NOT the unbound fields. Please confirm

Userlevel 2
Badge

@Naveen Boga  yes that was issue. Thank you very much.

Userlevel 7
Badge +17

@param2022  Expected :) Thanks for sharing the update.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved