Solved

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

  • 15 February 2023
  • 8 replies
  • 107 views

Userlevel 6
Badge +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.  

 

icon

Best answer by Joe Schmucker 15 February 2023, 18:20

View original

8 replies

Userlevel 7
Badge +5

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

Userlevel 6
Badge +3

 

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.

Userlevel 6
Badge +3

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?

Userlevel 6
Badge +3

@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?

Badge +11

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

Userlevel 6
Badge +3

@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.

Badge +11

Nope, that’s backwards 🙂

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

Custom fields are added in code.

Userlevel 6
Badge +3

@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!

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