Skip to main content
Answer

Set Selector Field Display Mode as Text in 2025R1

  • July 31, 2025
  • 2 replies
  • 75 views

Forum|alt.badge.img

Hi,

I have a selector field defined like this at DAC level,

 #region UsrSalesOfficesAP

 [PXDBInt()]

 [PXUIField(DisplayName = "Sales Office")]

 [PXSelector(typeof(Search<TSSalesOffices.recordID>),

             typeof(TSSalesOffices.salesOffice),

             SubstituteKey = typeof(TSSalesOffices.recordID),

             DescriptionField = typeof(TSSalesOffices.salesOffice),

             Filterable = true)]

 public virtual int? UsrSalesOfficesAP { get; set; }

 public abstract class usrSalesOfficesAP : PX.Data.BQL.BqlString.Field<usrSalesOfficesAP> { }

 #endregion

In Classic UI, the option's display mode is set to "Text", so the screen shows the text value, but the database stores the integer.

I applied the following in the Modern UI, but it’s not working as expected. I’ve included the Modern UI code below

Html File:

<template>

<qp-grid modify id="gridTransactions">

        Option 1: (Issue: Data getting vanished)

            <field after="#gridTransactions [name='CuryDiscAmt']"

                name="UsrSalesOfficesAP" config-display-mode.bind="text"></field>

       

       Option 2: (Issue: Displays integer value only)

            <field name="UsrSalesOfficesAP" value.bind="$record.UsrSalesOfficesAP" display-mode="text"></field>

    </qp-grid>

 </template>

 

TypeScript file: (If I add this, Getting IO Exception error while publishing package)

@columnConfig({

    displayMode: GridColumnDisplayMode.Both,

    editorConfig: {

        displayMode: "text",

        selectorMode: PXSelectorMode.TextModeEditable

    }

})

UsrSalesOfficesAP: PXFieldState<PXFieldOptions.CommitChanges>;

 

Can anyone give me any input on this?

 

Thank you in advance.

 

Premalatha N

Best answer by darylbowman

I think you can simply change the ‘SubstituteKey’ of the Selector to be the value you want to display:

SubstituteKey = typeof(TSSalesOffices.*fieldContainingText*),

2 replies

darylbowman
Captain II
Forum|alt.badge.img+15
  • Answer
  • July 31, 2025

I think you can simply change the ‘SubstituteKey’ of the Selector to be the value you want to display:

SubstituteKey = typeof(TSSalesOffices.*fieldContainingText*),


Forum|alt.badge.img
  • Author
  • Freshman I
  • August 1, 2025

Thank you ​@darylbowman. I had tried this earlier, but it started working after restarting IIS.

 

 

 

Regards,

Premalatha N