Hi Community,
How can I make the records notes entered from the “Weekly crew time entry” be updated to the “Employee's time card” when they are created?
Hi Community,
How can I make the records notes entered from the “Weekly crew time entry” be updated to the “Employee's time card” when they are created?
hi
We had similar kind of implementation where we are copying soline notes to shipment line.
you can refer the below sample code and implement in your graph.
public delegate void CreateShipmentDelegate(CreateShipmentArgs args);
PXOverride]
public virtual void CreateShipment(CreateShipmentArgs args, CreateShipmentDelegate baseMethod)
{
baseMethod(args);
SOOrder orderData = args.Order;
if (orderData != null)
{
SOOrderEntry soGraph = PXGraph.CreateInstance<SOOrderEntry>();
foreach (SOShipLine line in Base.Transactions.Select())
{
SOLine objLine = PXSelect<SOLine, Where<SOLine.orderNbr, Equal<Required<SOLine.orderNbr>>,
And<SOLine.orderType, Equal<Required<SOLine.orderType>>,
And<SOLine.inventoryID, Equal<Required<SOLine.inventoryID>>,
And<SOLine.lineNbr, Equal<Required<SOLine.lineNbr>>>>>>>
.Select(Base, line.OrigOrderNbr, line.OrigOrderType, line.InventoryID, line.LineNbr);
if (objLine != null)
{
soGraph.Transactions.Current = objLine;
PXNoteAttribute.SetNote(Base.Transactions.Cache, line, PXNoteAttribute.GetNote(soGraph.Transactions.Cache, soGraph.Transactions.Current));
Base.Transactions.Cache.Update(line);
}
}
Base.Actions.PressSave();
}
}
Hope this is Helpful.
Thanks very much !!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.