Skip to main content
Answer

Field on custom table not searchable in selector lookup but the other two work

  • February 23, 2023
  • 3 replies
  • 387 views

Joe Schmucker
Captain II
Forum|alt.badge.img+3

I have a custom table which is used for a selector on my extension of the PMTimeActivity graph.

When you click the lookup, you can see there are two records to choose from:

If you type “122”, you can see it finds the first record in the Plan Code field:

If you type “es”, if highlights both of the records in the Description column:

If you type “fs” I want it to show the first record in the selector as that has “FSDF” in the Alternate Plan Code column.

These are the pertinent DAC fields for the custom table

       #region PlanCD
        [PXDBString(50, IsUnicode = true, IsKey = true, InputMask = ">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")]
        [PXDBDefault]
        [PXUIField(DisplayName = "Plan Code", Required = true)]
        [PXCheckUnique(typeof(ICSPlan.planCD))]
        public virtual string PlanCD { get; set; }
        public abstract class planCD : PX.Data.BQL.BqlString.Field<planCD> { }
        #endregion

        #region LegacyPlanCD
        [PXDBString(50, IsUnicode = true, InputMask = ">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")]
        [PXUIField(DisplayName = "Alternate Plan Code")]
        [PXDBDefault(PersistingCheck = PXPersistingCheck.Nothing)]
        [PXCheckUnique(typeof(ICSPlan.legacyPlanCD))]
        public virtual string LegacyPlanCD { get; set; }
        public abstract class legacyPlanCD : PX.Data.BQL.BqlString.Field<legacyPlanCD> { }
        #endregion

        #region Description
        [PXDBString(256, IsUnicode = true)]
        [PXDBDefault]
        [PXUIField(DisplayName = "Description", Required = true)]
        public virtual string Description { get; set; }
        public abstract class description : PX.Data.BQL.BqlString.Field<description> { }
        #endregion
 

This is the DAC extension field used for the selector

        #region UsrPlanCD
        [PXDBString(50, IsUnicode = true)]
        [PXUIField(DisplayName = "Plan ID")]
        [PXSelector(typeof(SearchFor<ICSPlan.planCD>.Where<ICSPlan.active.IsEqual<True>>),
                typeof(ICSPlan.planCD),
                typeof(ICSPlan.legacyPlanCD),
                typeof(ICSPlan.description),
                SubstituteKey = typeof(ICSPlan.planCD),
                DescriptionField = typeof(ICSPlan.description))]
        public string UsrPlanCD { get; set; }
        public abstract class usrPlanCD : PX.Data.BQL.BqlString.Field<usrPlanCD> { }
        #endregion
 

Any ideas what I need to do to make the Alternate Plan Code column searchable in the selector?  Is my DAC extension and DAC setup properly?  

 

Best answer by Django

There is a setting for the selector field in the screen editor ‘Layout Properties’ tab called FilterByAllFields.  See if setting that to True helps.

 

 

3 replies

Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 23, 2023

I have tried making the Legacy Plan CD field Required, and I also tried setting the IsKey = true on that field but it made no difference.  Putting capital FS does not matter either.  I did find that you can filter on the legacy column and if you put Contains “FS” it filters the records and shows it.  But that is not acceptable to our customer.


Forum|alt.badge.img+7
  • Captain II
  • Answer
  • February 23, 2023

There is a setting for the selector field in the screen editor ‘Layout Properties’ tab called FilterByAllFields.  See if setting that to True helps.

 

 


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 23, 2023

@Django YOU ARE MY HERO.  😁  Worked!