Skip to main content
Question

Change Location DescriptionField attribute to pull from another DAC

  • February 28, 2024
  • 4 replies
  • 209 views

Hi,

I need to change what displays on the SO screen when selected a Location.    By default, it is
LocationCD - Descr

 

 

We want to change it to LocationCD - AddressLine1

I can add the field easy enough in the Selector, but how can I add it to the DescriptionField ?  If I change it to

  • DescriptionField = typeof(Address.addressLine1),

It just shows the locationCD on screen. 

I realize it is from a different DAC, so I guess the question is how do I get the info from the other DAC?

 

Thanks in advance.

 

[PXCustomizeSelectorColumns(
typeof(PX.Objects.CR.Location.locationCD),
typeof(PX.Objects.CR.Location.descr),
typeof(PX.Objects.CR.Address.addressLine1))]

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



[PXDefault(typeof(Coalesce<Search2<BAccountR.defLocationID,
InnerJoin<CRLocation, On<CRLocation.bAccountID, Equal<BAccountR.bAccountID>, And<CRLocation.locationID, Equal<BAccountR.defLocationID>>>>,
Where<BAccountR.bAccountID, Equal<Current<SOOrder.customerID>>,
And<CRLocation.isActive, Equal<True>,
And<MatchWithBranch<CRLocation.cBranchID>>>>>,
Search<CRLocation.locationID,
Where<CRLocation.bAccountID, Equal<Current<SOOrder.customerID>>,
And<CRLocation.isActive, Equal<True>, And<MatchWithBranch<CRLocation.cBranchID>>>>>>))]
[PXForeignReference(
typeof(CompositeKey<
Field<SOOrder.customerID>.IsRelatedTo<Location.bAccountID>,
Field<SOOrder.customerLocationID>.IsRelatedTo<Location.locationID>,
Field<Location.defAddressID>.IsRelatedTo<Address.addressID>
>))]

 

When I change
DescriptionField = typeof(Address.addressLine1)

It just shows the ID:


Drop down fine

 

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • March 2, 2024

@aallande  You need to add the DisplayMode property as “Hint” for the Selector field in the .aspx page like below.

 

 


  • Author
  • Freshman I
  • March 4, 2024

Naveen,

Thank you for your response.  However the “Description” is from a different DAC. 

If I just add “Hint” as you note, it doesn’t change anything.   I need to specify where, in your case, “Test Description” is coming from.  I want it to come from Address.AddressLine1 where the field is Location.LocationID.
 

So in the end it will say “LocationID - AddressLine1”   Not “LocationID-LocationDescription”

Appreciate any further insight


  • Author
  • Freshman I
  • March 5, 2024

@Naveen Boga 

Naveen,

Thank you for your response.  However the “Description” is from a different DAC. 

If I just add “Hint” as you note, it doesn’t change anything.   I need to specify where, in your case, “Test Description” is coming from.  I want it to come from Address.AddressLine1 where the field is Location.LocationID.
 

So in the end it will say “LocationID - AddressLine1”   Not “LocationID-LocationDescription”

Appreciate any further insight


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • April 3, 2024

Hi @aallande were you able to find a solution? Thank you!