Skip to main content
Solved

Configuring custom selector to use a custom field value

  • February 6, 2025
  • 5 replies
  • 79 views

  • Freshman II
  • 8 replies

Hi, I currently have new fields on the Tools screen to make it more useful. I have a custom selector called AMToolMstExt.usrToolLocation and AMToolMstExt.useToolWarehouse. The custom warehouse selector works fine, but I want the selector for the location to show a list of locations that belong to the warehouse contained in the custom warehouse field. 

I am trying to use PXSelector and a BQL to relate the list of locations in the selector to the value stored in AMToolMstExt.usrToolWarehouse.

Here is the current setup for AMToolMstExt.usrToolLocation:

 

Here is the current setup for AMToolMstExt.usrToolWarehouse:

 

Here is what currently happens, with all of the locations in the system showing up: 

In the above example, only the locations starting with ‘03’ should be showing, since ‘03’ is in the custom warehouse selector field.

Best answer by aiwan

@u662 

 

You should update your other selector to read the SiteID field then, you can use the “SubsituteKey = typeof(INSite.siteCD)” to display the value as the siteCD value.

Your selector will look somehting like this:

[PXSelector(typeof(CalibrationHeader.docID),
    typeof(CalibrationHeader.docNbr),
    typeof(CalibrationHeader.date),
    typeof(CalibrationHeader.siteID), SubstituteKey = typeof(CalibrationHeader.docNbr), ValidateValue = false)]

 

View original
Did this topic help you find an answer to your question?

5 replies

Forum|alt.badge.img+1
  • Jr Varsity III
  • 76 replies
  • February 7, 2025

Hi ​@u662 , Hope, this link helps you to load data in one selector from another selector selected value.

 


Forum|alt.badge.img+8
  • Captain II
  • 378 replies
  • February 7, 2025

Hi ​@u662 

 

Please try changing your siteID to siteCD, these are two different values, ID is the unique key which is usually an integer, and the CD is the masked, more user friendly value, usually what you see on the screen.

 

Aleks


  • Author
  • Freshman II
  • 8 replies
  • February 7, 2025
aiwan wrote:

Hi ​@u662 

 

Please try changing your siteID to siteCD, these are two different values, ID is the unique key which is usually an integer, and the CD is the masked, more user friendly value, usually what you see on the screen.

 

Aleks

@aiwan SiteCD is not a field within INLocation

 


Forum|alt.badge.img+8
  • Captain II
  • 378 replies
  • Answer
  • February 7, 2025

@u662 

 

You should update your other selector to read the SiteID field then, you can use the “SubsituteKey = typeof(INSite.siteCD)” to display the value as the siteCD value.

Your selector will look somehting like this:

[PXSelector(typeof(CalibrationHeader.docID),
    typeof(CalibrationHeader.docNbr),
    typeof(CalibrationHeader.date),
    typeof(CalibrationHeader.siteID), SubstituteKey = typeof(CalibrationHeader.docNbr), ValidateValue = false)]

 


  • Author
  • Freshman II
  • 8 replies
  • February 11, 2025
aiwan wrote:

@u662 

 

You should update your other selector to read the SiteID field then, you can use the “SubsituteKey = typeof(INSite.siteCD)” to display the value as the siteCD value.

Your selector will look somehting like this:

[PXSelector(typeof(CalibrationHeader.docID),
    typeof(CalibrationHeader.docNbr),
    typeof(CalibrationHeader.date),
    typeof(CalibrationHeader.siteID), SubstituteKey = typeof(CalibrationHeader.docNbr), ValidateValue = false)]

 

This answer from ​@aiwan is ultimately correct. I had to unpublish and then republish to get the changes to work for some reason.

 

Here’s my final code:

Warehouse (AMToolMstExt.usrToolWarehouse)

using PX.Objects.IN;

[PXDBString(30)]
[PXUIField(DisplayName="Warehouse")]
[PXSelector(typeof(Search<INSite.siteID>), typeof(INSite.siteCD), typeof(INSite.descr), SubstituteKey = typeof(INSite.siteCD))]

 

Location (AMToolMstExt.usrToolLocation)

using PX.Objects.IN;
using PX.Objects.AM;

[PXDBString(30)]
[PXUIField(DisplayName="Location")]
[PXSelector(typeof(Search<INLocation.locationCD, Where<INLocation.siteID, Equal<Current<AMToolMstExt.usrToolWarehouse>>>>), typeof(INLocation.locationCD), typeof(INLocation.siteID), SubstituteKey = typeof(INLocation.locationCD), DescriptionField = typeof(INLocation.descr))]

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings