Solved

How to change to display more address fields in Sales Order Screen when selecting location

  • 27 December 2021
  • 1 reply
  • 277 views

Userlevel 6
Badge +5

I have seen a customized change that displays more address fields when selecting the location in the header of the sales order screen.  However, I do not know what mechanism was used to create this change.  It does not appear that the screen editor allows you to make changes to the window that pops up when you click to search for the location.  Standard functionality when selecting the location is just to show 2 fields.  The customized functionality displays address 1, address 2, ZipCode, etc….

 

Can anyone point me in the right direction to what tool/method would be the place to start in investigating how to accomplish this?

icon

Best answer by mvolshteyn 29 December 2021, 09:21

View original

1 reply

Userlevel 5
Badge +3

@ltussing03 ,  you just need to replace the LocationActive attribute for the SOOrder.customerLocationID field with the signature allowing joins and add the columnd using the additional PXCustomizeSelectorColumns attribute. 

Original attribute:

[LocationActive(typeof(Where<Location.bAccountID, Equal<Current<SOOrder.customerID>>,
And<MatchWithBranch<Location.cBranchID>>>), DescriptionField = typeof(Location.descr), Visibility = PXUIVisibility.SelectorVisible)]

Needed attributes:

		[LocationActive(typeof(Where<Location.bAccountID, Equal<Current<SOOrder.customerID>>,
And<MatchWithBranch<Location.cBranchID>>>),
typeof(InnerJoin<Address, On<Address.addressID, Equal<Location.defAddressID>>>), DescriptionField = typeof(Location.descr), Visibility = PXUIVisibility.SelectorVisible)]
[PXCustomizeSelectorColumns(typeof(Address.addressLine1), typeof(Address.city))] //here, you can specify the needed list of fields to display in the selector

In partucular, you need to create an Extension of SOOrder and do this replacement through the _CacheAttached event:

public class SOOrderEntryCommunity7713 : PXGraphExtension<SOOrderEntry>
{
[PXMergeAttributes(Method = MergeMethod.Merge)]
[PXRemoveBaseAttribute(typeof(LocationActiveAttribute))]
[LocationActive(typeof(Where<Location.bAccountID, Equal<Current<SOOrder.customerID>>,
And<MatchWithBranch<Location.cBranchID>>>),
typeof(InnerJoin<Address, On<Address.addressID, Equal<Location.defAddressID>>>), DescriptionField = typeof(Location.descr), Visibility = PXUIVisibility.SelectorVisible)]
[PXCustomizeSelectorColumns(typeof(Address.addressLine1), typeof(Address.city))] //
protected virtual void SOOrder_CustomerLocationID_CacheAttached(PXCache sender)
{
}
}

 

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