Skip to main content
Answer

Display of a custom field that is a masked field not displaying like I want

  • February 15, 2023
  • 8 replies
  • 233 views

Joe Schmucker
Captain II
Forum|alt.badge.img+3

What do I need to do to get a UDF field to behave like a masked field?

I am adding a UDF to the SO Types screen

The field is supposed to be the same field type as the Combine Sales Sub. From field.  It will be used to override the sub account field on the SO Entry screen if there is a value in the UDF

The custom field does not “act” like a masked field.  It behaves like a regular text field.

This is my UDF DAC field.  

        #region UsrSalesSubMaskOverride
        public abstract class usrSalesSubMaskOverride : PX.Data.BQL.BqlString.Field<usrSalesSubMaskOverride> { }
        protected String _UsrSalesSubMaskOverride;
        //[PXDefault]
        //[PXUIRequired(typeof(Where<active, Equal<True>>))]
        [SOSalesSubAccountMask(DisplayName = "Channel/Modality Override")]
        public String UsrSalesSubMaskOverride
        {
            get { return this._UsrSalesSubMaskOverride; }
            set { this._UsrSalesSubMaskOverride = value; }
        }
        #endregion

It is a copy of the field from this field from the SOOrderEntry.cs file:

public partial class SOOrderType : IBqlTable, PXNoteAttribute.IPXCopySettings

        #region SalesSubMask
        public abstract class salesSubMask : PX.Data.BQL.BqlString.Field<salesSubMask> { }
        protected String _SalesSubMask;
        [PXDefault]
        [PXUIRequired(typeof(Where<active, Equal<True>>))]
        [SOSalesSubAccountMask(DisplayName = "Combine Sales Sub. From")]
        public virtual String SalesSubMask
        {
            get { return this._SalesSubMask; }
            set { this._SalesSubMask = value; }
        }
        #endregion

I don’t know what I need to do to make my field behave like a masked sub account field.

Please help me.  

 

Best answer by Joe Schmucker

@Django The field seems to work on the SO Types screen, but the DAC shows errors.

 

one of the recommended potential fixes is to add a [PXStringList] attribute.  It works without making any changes so do you think it is ok to use as is?

8 replies

Forum|alt.badge.img+7
  • Captain II
  • February 15, 2023

What do the properties of the field on the UI for this field look like?


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 15, 2023

 

You made me think to look at the field type on the aspx.  it was PXTextEdit so I edited the aspx to be a PXSegmentMask 

When I put a value in the UDF now, I get this error:

It looks like I need to make this field a selector.  But, the field from the SOEntry DAC does not have a selector.  I hoped that the  [SOSalesSubAccountMask(DisplayName = "Channel/Modality Override")] would make it a selector.


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 15, 2023

I drilled into the definition of SOSalesSubAccountMask and found this attribute.

[SOSalesAcctSubDefault.SubList]

When I add that attribute to my DAC, it now works.  

Shouldn’t that happen automatically since I put SOSalesSubAccountMask on my field?


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • Answer
  • February 15, 2023

@Django The field seems to work on the SO Types screen, but the DAC shows errors.

 

one of the recommended potential fixes is to add a [PXStringList] attribute.  It works without making any changes so do you think it is ok to use as is?


darylbowman
Captain II
Forum|alt.badge.img+15

For what it’s worth, User Defined Fields (UDFs) are NOT the same as custom fields.


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 15, 2023

@darylbowman Thanks for pointing that out. I don’t know what the difference is, but.I’ll not use custom when I am referring to a UDF going forward.


darylbowman
Captain II
Forum|alt.badge.img+15

Nope, that’s backwards 🙂

UDFs are defined in Attributes and can be added to entry screens without code.

Custom fields are added in code.


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • February 15, 2023

@darylbowman Got it.  Thanks!  When we create new fields through code, we still put Usr as a prefix for DAC Extension fields.  I guess that was my confusion on that one.  

I appreciate you taking to time to educate me on that!