Does anyone have a solution on how we can copy user-defined fields values across these screens when we create a shipment from a sales order and an invoice from the shipment?
Copying User Defined Fields acrross the sales order, shipment and invoice screen
I did with the first one and It did not work, I am not looking for the the one that copies custom fields but rather UDF which you define on the screen with attributes
Hi
As suggest by fellow community members, you can use PXGraph.InstanceCreated.AddHandler within which you can set the UDF value in the RowPersisting event.
Within row persisting event, you can use Cache.GetValueExt and Cache.SetValueExt method to fetch the value and set the value of the UDF. Below is an example implementation you can reference,
public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
{
#region Event Handlers
public delegate IEnumerable CreateShipmentIssueDelegate(PXAdapter adapter, Nullable<DateTime> shipDate, Nullable<Int32> siteID);
[PXOverride]
public IEnumerable CreateShipmentIssue(PXAdapter adapter, Nullable<DateTime> shipDate, Nullable<Int32> siteID, CreateShipmentIssueDelegate baseMethod)
{
PXGraph.InstanceCreated.AddHandler<SOShipmentEntry>((graphShipmentEntry) =>
{
graphShipmentEntry.RowPersisting.AddHandler<SOShipment>((sender, e) =>
{
var AttributeAMBATLEN = Base.Document.Cache.GetValueExt(Base.Document.Current, "AttributeAMBATLEN");
graphShipmentEntry.Document.Cache.SetValueExt(graphShipmentEntry.Document.Current, "AttributeAMBATLEN", AttributeAMBATLEN.ToString());
});
});
return baseMethod(adapter,shipDate,siteID);
}
#endregion
}
I have also attached the customization package, which copies the AMBATLEN attribute from SO → Shipment → Invoice.
Note: In GetValueExt and SetValueExt, you need to prefix the attribute id with Attribute
Feel free to post if you have any questions. Good Luck,
This worked perfectly thank you very much. And the attribute prefix was a missing link I was using the usr prefix.
Does anyone have a solution on how we can copy user-defined fields values across these screens when we create a shipment from a sales order and an invoice from the shipment?
This answer worked from transactions that goes through the process from sales order to shipment to invoice. For transactions that does not require shipment that goes from sales order to invoice it's not copying. How can I modify the code to accommodate this
Hi
As suggest by fellow community members, you can use PXGraph.InstanceCreated.AddHandler within which you can set the UDF value in the RowPersisting event.
Within row persisting event, you can use Cache.GetValueExt and Cache.SetValueExt method to fetch the value and set the value of the UDF. Below is an example implementation you can reference,
public class SOOrderEntry_Extension : PXGraphExtension<PX.Objects.SO.SOOrderEntry>
{
#region Event Handlers
public delegate IEnumerable CreateShipmentIssueDelegate(PXAdapter adapter, Nullable<DateTime> shipDate, Nullable<Int32> siteID);
[PXOverride]
public IEnumerable CreateShipmentIssue(PXAdapter adapter, Nullable<DateTime> shipDate, Nullable<Int32> siteID, CreateShipmentIssueDelegate baseMethod)
{
PXGraph.InstanceCreated.AddHandler<SOShipmentEntry>((graphShipmentEntry) =>
{
graphShipmentEntry.RowPersisting.AddHandler<SOShipment>((sender, e) =>
{
var AttributeAMBATLEN = Base.Document.Cache.GetValueExt(Base.Document.Current, "AttributeAMBATLEN");
graphShipmentEntry.Document.Cache.SetValueExt(graphShipmentEntry.Document.Current, "AttributeAMBATLEN", AttributeAMBATLEN.ToString());
});
});
return baseMethod(adapter,shipDate,siteID);
}
#endregion
}
I have also attached the customization package, which copies the AMBATLEN attribute from SO → Shipment → Invoice.
Note: In GetValueExt and SetValueExt, you need to prefix the attribute id with Attribute
Feel free to post if you have any questions. Good Luck,
This answer worked from transactions that goes through the process from sales order to shipment to invoice. For transactions that does not require shipment that goes from sales order to invoice it's not copying. How can I modify the code to accommodate this
Hi
You can override the PrepareInvoice action in the SOOrderEntry. Following thread has an example,
Note: You modify the example to copy the UDF instead of custom fields. Feel free to post if you have any questions. Good Luck,
Hi
You can override the PrepareInvoice action in the SOOrderEntry. Following thread has an example,
Note: You modify the example to copy the UDF instead of custom fields. Feel free to post if you have any questions. Good Luck,
I am fairly new to Acumatica development I am struggling to override the Prepare Invoice action while at the same time maintaining the original code that copies my UDF Can you or someone please kindly modify the D20963 customization package that you sent so that it accommodates instances where the item does not require shipment, going straight from SO to invoice?
Hi
Sure, I have attached the updated customization package for your reference. Good Luck,
Hi
Sure, I have attached the updated customization package for your reference. Good Luck,
Thanks, I have managed to replicate the example in my solution, and it worked.😊
Hi
Sure, I have attached the updated customization package for your reference. Good Luck,
Hi Vignesh have you noticed that if the attribute is a dropdown (combo) it doesn't copy? But all the other control types are copying perfectly.
Or is there a way in which we need to declare it in the code?
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/3bcf4bd3-d178-4b91-9c05-726316b60297.png)
I have figured out that the value ID needs to be equal to the Description for it to copy if not It won’t. Is there a way to resolve this?
![](https://uploads-us-west-2.insided.com/acumatica-en/attachment/c88761a1-6e30-4526-9c9c-7f28d38d578f.png)
Hi
For the Combo control type attribute, try like below,
var AttributeAMBATCOLOR = (PXStringState)Base.Document.Cache.GetValueExt(Base.Document.Current, "AttributeAMBATCOLOR");
graphShipmentEntry.Document.Cache.SetValueExt(graphShipmentEntry.Document.Current, "AttributeAMBATCOLOR", AttributeAMBATCOLOR.Value);
TypeCast the GetValueExt PXStringState, then use Value to get the value of the selected combo value.
Hope that helps.! Feel free to post if you have any questions.! Good Luck,
I bHi
For the Combo control type attribute, try like below,
var AttributeAMBATCOLOR = (PXStringState)Base.Document.Cache.GetValueExt(Base.Document.Current, "AttributeAMBATCOLOR");
graphShipmentEntry.Document.Cache.SetValueExt(graphShipmentEntry.Document.Current, "AttributeAMBATCOLOR", AttributeAMBATCOLOR.Value);
TypeCast the GetValueExt PXStringState, then use Value to get the value of the selected combo value.
Hope that helps.! Feel free to post if you have any questions.! Good Luck,
Hi team, I have another tricky one A client has custom fields (not User defined fields) on the issues screen on the summary area. The same fields exists on the SO invoice screen on the summary area. The fields needs to be copied from the invoice to the issues screen for the issue that is created in the back ground when you release the SO invoice. Which method should I be overriding and how. Its slightly different from the above because the action would take you to the next screen etc
Hi
For the Combo control type attribute, try like below,
var AttributeAMBATCOLOR = (PXStringState)Base.Document.Cache.GetValueExt(Base.Document.Current, "AttributeAMBATCOLOR");
graphShipmentEntry.Document.Cache.SetValueExt(graphShipmentEntry.Document.Current, "AttributeAMBATCOLOR", AttributeAMBATCOLOR.Value);
TypeCast the GetValueExt PXStringState, then use Value to get the value of the selected combo value.
Hope that helps.! Feel free to post if you have any questions.! Good Luck,
Hey Vignesh-
This change does not appear to work for combo’s….
24R1
-Chad
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.