Skip to main content

Increasing length of the Pay Item CD field


Forum|alt.badge.img

Hi,

I have created a Database Script to increase the length of the PayItemCD field from 10 to 20, but I can't seem to find where to do this for the on-screen field shown below.

I can type as many characters as I like into the Pay Item field, but once I click into another field, it cuts it down to 10 characters.

I have updated the MaxLength property of the field, but that hasn't seemed to help.

Is there another way to increase the length of this field?

Kind regards,

Andrew

 

Enter as many characters as I want

 

After clicking out of the field, text is shortened to 10 characters

 

Max Length property set to 20

 

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

8 replies

Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+5

Hi @AndrewA 

You have to change the field declaration in the specific DAC

You can see in this example changing a column on the table Contract

Customization Project

 

Also I suggest to change sizes or define new columns or tables through the Database Scripts no code option. Acumatica sometimes add additional definitions on tables and columns that are optimized

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 80 replies
  • March 27, 2024

Hi @Leonardo Justiniano ,

Thanks for your response. I have created the Database Script the way you mentioned, so it should be all good on the database side. For the on-screen field, I have added the PXDBString change to the field, as shown below, but it still doesn't do anything.

It may have something to do with the fact that no attributes seem to appear in this screen, so I am not sure if the attributes are able to be amended. Is it blank for you as well?

Are there any other ways for the length of on-screen fields to be extended?

Kind regards,

Andrew

 


Sagar Greytrix
Captain II
Forum|alt.badge.img+3

Hi @AndrewA,

This blog will help you to extend field length in Acumatica.

Regards,

Sagar, Greytrix


Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+5

@AndrewA

 

The way you are defining the change sounds good “Replace Original” You are missing, though, the labeling. You need to add on a replace:

[PXUIField(DisplayName = ".. Label ..")]

Sometimes the screen editor does not show the base definition properly (glitches or ISV components). For I can see also in your screenshot you are trying to modify a field from a 3rd party provider (ISV) or Internal development. I recommend to request the change to them. Otherwise, inspect the record and determine the class and then implement a cache attached replacement:

 

...
using MYOB.AdvanceLive.People.Objects.PP;

public class XYZ_Graph_Extension : PXGraphExtension<XYZ_Graph>
{

...

  [PXMergeAttributes(Method = MergeMethod.Replace)]
  [PXUIField(DisplayName = ".. LABEL ..")]
  [PXDBString(20, IsKey = true, IsUnicode = true, InputMask = "CCCCCCCCCCCCCCCCCCCC")]
  protected void _(Events.CacheAttached<MPPayItem.payItemCD> e) { }

...

}

 

Also, as @Sagar Greytrix mentioned, take a look to the blog. If the DAC fields do not appear in the DATA ACCESS section you must have them declared in the CODE section as a DAC class. If it is an not there, must be an external library or the declaration is in another package, Find the package and make the change. As I stated above, you are at risk if the provider of the package comes with a new version which will override your change.

 


Forum|alt.badge.img
  • Author
  • Varsity I
  • 80 replies
  • April 5, 2024

Hi @Leonardo Justiniano ,

Thanks for your response. I gave the customisation a go and it didn't work, so I will see if I can find this external library to make the change there.

Kind regards,

Andrew


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2640 replies
  • June 3, 2024

Hi @AndrewA were you able to find a solution? Thank you!


Forum|alt.badge.img
  • Author
  • Varsity I
  • 80 replies
  • June 4, 2024

Unfortunately not, but we should be able to make do with how it is. Thanks everyone for your help!


andriitkachenko
Jr Varsity I
Forum|alt.badge.img+5

Hi @AndrewA 

This might be because the graph itself has attributes overridden.

Try creating a graph extension (not DAC extension!) for MPPayItemMaint and add this CacheAttached event there:

        [PXDBString(20, InputMask = ">CCCCCCCCCCCCCCCCCCCC", IsUnicode = true, IsKey = true)]
        [PXUIField(DisplayName = "Pay Item ID")]
        [MYOB.AdvancedLive.People.Objects.PP.CustomAttributes.Lookups.PayItemSelectorListAttribute(
            typeof(MYOB.AdvancedLive.People.Objects.PP.POCOS.RollupPayItemLookupItem.payItemCD), typeof(RollupPayItemLookupItem.payItemCD)
            , typeof(RollupPayItemLookupItem.displayName)
            , typeof(RollupPayItemLookupItem.unitType)
            , typeof(RollupPayItemLookupItem.taxation)
            , typeof(RollupPayItemLookupItem.isActive))]
        [AutoNumberAttr(typeof(Search<MPSetup.payItemNumberingID>), typeof(AccessInfo.businessDate))]
        public virtual void MPPayItem_PayItemCD_CacheAttached(PXCache cache)
        {
        }

You can keep the MPPayItem extension in your customization. Please note that you might need to repeat this process on other screens in case they have the attribute set changed as well (check that this solution helped you on 1 screen first though).


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