Skip to main content
Answer

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

  • December 27, 2021
  • 1 reply
  • 316 views

Forum|alt.badge.img+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?

Best answer by mvolshteyn

@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)
{
}
}

 

1 reply

mvolshteyn
Acumatica Moderator
Forum|alt.badge.img+3
  • Technical Account Manager in the ISV Team
  • Answer
  • December 29, 2021

@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)
{
}
}