Skip to main content
Solved

Selector is appearing a textbox


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

View original
Did this topic help you find an answer to your question?

6 replies

Forum|alt.badge.img+6
  • Captain II
  • 567 replies
  • 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

@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
  • 3 replies
  • April 2, 2025

This is not working. 

 


Forum|alt.badge.img

@anupusefulbi 

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


Forum|alt.badge.img
  • Jr Varsity I
  • 71 replies
  • 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
  • 379 replies
  • 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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings