Solved

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

  • 23 February 2023
  • 3 replies
  • 172 views

Userlevel 6
Badge +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?  

 

icon

Best answer by Django 23 February 2023, 18:13

View original

3 replies

Userlevel 6
Badge +3

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.

Userlevel 7
Badge +5

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

 

 

Userlevel 6
Badge +3

@Django YOU ARE MY HERO.  😁  Worked!

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved