'Adding warehouse selector to the custom field in acumatica

I created a custom field and trying to add the warehouse selector to it.I try to read from the customization guide and tried it but,the selector does not show up in the custom field. This is the code I tried. #region UsrCustomSite [PXDBInt] [PXUIField(DisplayName="Warehouse", Visibility = PXUIVisibility.SelectorVisible)] [PXSelector(typeof(Search<IN.INSite.siteCD>),typeof(IN.INSite.descr),DescriptionField =(typeof(IN.INSite.siteCD)),SubstituteKey =(typeof(IN.INSite.siteCD)),DirtyRead =true)] public virtual int? UsrCustomSite { get; set; } public abstract class usrCustomSite : PX.Data.BQL.BqlInt.Field { } #endregion Am I missing something here?



Solution 1:[1]

I would try changing

[PXSelector(typeof(Search<IN.INSite.siteCD>)

to

[PXSelector(typeof(Search<IN.INSite.siteID>)

You are storing an int so you want the id, the substitute Key setting will make it so that the UI will show the CD.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Patrick Chen