Skip to main content
Answer

Selector is appearing a textbox

  • April 1, 2025
  • 6 replies
  • 101 views

I have created a Form and added Generic Inquiry as an Entry Screen. When ever I am Adding new record I am navigated to the main form screen From GI

Problem :-- I have defined Account CD as Selector, But it is still a text box appearing on the screen

 

Best answer by Ankita Tayana

Hi ​@anupusefulbi,

I noticed that the Account CD field in the Customer Material Allocation screen is appearing as a text box instead of a selector. After reviewing the implementation, I believe the issue is due to the field being added to the UI before the PXSelector attribute was applied in the DAC.

 

To resolve this, please follow these steps:

  1.  Remove the Field from the UI:
  2. Open the Customization Project Editor.
  3. Remove the Acctcd field from the form layout.

Save and Publish the customization.

 

Ensure the PXSelector Attribute is Defined in the DAC:

[PXDBString(30, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Account CD")]
[PXSelector(typeof(Search<BAccount.acctCD>),
    typeof(BAccount.acctCD),
    typeof(BAccount.acctName),
    SubstituteKey = typeof(BAccount.acctCD),
    DescriptionField = typeof(BAccount.acctName))]
public virtual string Acctcd { get; set; }


Re-add the Field to the UI:

 

  1.  Go back to the Customization Project Editor.
  2. Re-add Acctcd to the UI.
  3. Ensure the Control Type is set to Selector.
  4. Clear Cache & Republish:

This should correctly display the Account CD field as a selector in the UI. Let me know if you need any further assistance!

Regards,

Ankita Tayana

6 replies

Forum|alt.badge.img+7
  • Captain II
  • April 1, 2025

If you added the PXSelector attribute after you created the control on the screen you just need to remove the control and re-add it. That should give you a selector control.

And, as an aside, that field should probably be PXDBInt and hold the BAccount.AcctID field with a substitute field showing the BAccount.AcctCD field.


Forum|alt.badge.img+1
  • Semi-Pro III
  • April 2, 2025

@anupusefulbi 

Use the code below to retrieve customers in the selector

#region CustomerID
[CustomerActive]
[PXUIField(DisplayName = "Account CD")]
public int? CustomerID { get; set; }
public abstract class customerID : PX.Data.BQL.BqlInt.Field<customerID> { }
#endregion

Thanks


  • Author
  • Freshman I
  • April 2, 2025

This is not working. 

 


Forum|alt.badge.img+1
  • Semi-Pro III
  • April 2, 2025

@anupusefulbi 

Could you share what exactly is not working and what you have tried so far?


Forum|alt.badge.img+5
  • Jr Varsity I
  • Answer
  • April 2, 2025

Hi ​@anupusefulbi,

I noticed that the Account CD field in the Customer Material Allocation screen is appearing as a text box instead of a selector. After reviewing the implementation, I believe the issue is due to the field being added to the UI before the PXSelector attribute was applied in the DAC.

 

To resolve this, please follow these steps:

  1.  Remove the Field from the UI:
  2. Open the Customization Project Editor.
  3. Remove the Acctcd field from the form layout.

Save and Publish the customization.

 

Ensure the PXSelector Attribute is Defined in the DAC:

[PXDBString(30, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Account CD")]
[PXSelector(typeof(Search<BAccount.acctCD>),
    typeof(BAccount.acctCD),
    typeof(BAccount.acctName),
    SubstituteKey = typeof(BAccount.acctCD),
    DescriptionField = typeof(BAccount.acctName))]
public virtual string Acctcd { get; set; }


Re-add the Field to the UI:

 

  1.  Go back to the Customization Project Editor.
  2. Re-add Acctcd to the UI.
  3. Ensure the Control Type is set to Selector.
  4. Clear Cache & Republish:

This should correctly display the Account CD field as a selector in the UI. Let me know if you need any further assistance!

Regards,

Ankita Tayana


Forum|alt.badge.img+8
  • Captain II
  • April 3, 2025

If your code is not compiled, you need to unpublish and republish your customisations for the changes to taken effect.

 

Also, you need to remove the field from the UI and add it back so it can get the PXSelector control.