Platform API: Introduction of the PXCopyPasteEmptyFields Attribute

In previous versions of MYOB Acumatica, if a document was copied that had empty elements and then this document was pasted, the empty elements were filled in with their corresponding default values. In MYOB Acumatica 2024.2.1, this behavior has been modified to provide more control to a developer.

A developer can now specify the fields whose corresponding elements should remain empty and not be filled in with default values when these fields are empty in the document that is going to be copied and pasted. To do this, the developer adds the PXCopyPasteEmptyFields attribute to the appropriate data view in the corresponding graph, and lists the fields as parameters of this attribute. The following code shows an example.

[PXCopyPasteEmptyFields(
  typeof(ARShippingContact.fullName),
  typeof(ARShippingContact.attention),
  typeof(ARShippingContact.phone1),
  typeof(ARShippingContact.email))]
public PXSelect<ARShippingContact, 
        Where<ARShippingContact.contactID, 
        Equal<Current<ARInvoice.shipContactID>>>> Shipping_Contact;