Solved

How to hide selector on a maintenance screen

  • 12 April 2023
  • 6 replies
  • 104 views

Userlevel 6
Badge +3

I have a custom maintenance screen and a related custom table.  There is a field I want to use as a selector on other custom screens.  

On the maintenance screen where you maintain the items for the selector, the field is showing a selector on it.  

DAC Field:

        #region NCRDispCD
        [PXDBString(2, IsFixed = true, IsKey = true)]
        [PXCheckUnique(typeof(SSGNCRDisp.nCRDispCD))]
        [PXUIField(DisplayName = "Disposition CD", Visibility = PXUIVisibility.SelectorVisible)]
        [PXSelector(typeof(Search<SSGNCRDisp.nCRDispCD>),
            typeof(SSGNCRDisp.nCRDispCD),
            typeof(SSGNCRDisp.description))]
        public virtual string NCRDispCD { get; set; }
        public abstract class nCRDispCD : PX.Data.BQL.BqlBool.Field<nCRDispCD> { }
        #endregion
I tried making this field without a selector and adding the selector in the cache attached of the other screens but that didn’t work and seems like a bad way of trying to do this.

 

 

In the Project Editor, I cannot find any options to hide the selector in any of the options.  I also added the filed to the Levels so I could see if there was an option in the Field Editor but I cannot find anything.

What can I do the hide the selector on the maintenance screen?

icon

Best answer by Django 12 April 2023, 18:52

View original

6 replies

Userlevel 7
Badge +5

Are you wanting to make that field read-only?  Setting Enabled=False will make the selector go away.  Or if you’re trying to prevent the user form making any changes to that grid, you can do that other ways as well.

Userlevel 6
Badge +3

I want the field to be a selector on other screens that will store the CD value of that field from the maintenance table.  That works fine. On the maintenance screen where you create the CD’s to use for lookups, there is a selector on the field.  On the maintenance screen (setup), it should be an entry field with just two characters, not a lookup.  The “setup” screen is just a grid with the values to store in the maintenance table.  You should not be able to lookup the value of the field, since the grid is a listing of all the values in the table.

In the Acumatica Training code, they setup up the maintenance screen like this:

 

I could easily do it that way and the field could be a selector.  But I want it to be a grid where you can import items so you don’t have to manually enter them.  In my grid screen shot in my original post, that screen does what I want.  I just want to hide the selector.  If it is not possible, then I will re-design my maintenance screen like the one in the training code.  I suppose they could do an import using an import scenario.

Userlevel 7
Badge +5

You can change the editor type when you are adding controls to the form. Typically we scroll down the list of fields, place a check mark under "Create Control" and then hit the button to have the controls created for us.

But, if you look to the right of the field list, you can change the type of control from Selector to Text (going by memory at the moment) so that when you click the button to create the controls on the form, it will be created as a text without the selector.

Userlevel 6
Badge +3

@Django Thank you!  I did not know I could change the control type when adding a field.

Userlevel 4
Badge +1

@Joe Schmucker DispositionCD filed you can give enabled=false inside DAC.

Userlevel 7
Badge +8

@Joe Schmucker

This might be a late comment but I guess your best bet for this specific case is to remove the selector attribute of the DAC Field using CacheAttached event in your maintenance graph like

[PXMergeAttributes(Method = MergeMethod.Append)]
[PXRemoveBaseAttribute(typeof(PXSelectorAttribute))]
protected virtual void _(Events.CacheAttached<YourDAC.nCRDispCD> e) { }

 

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