Skip to main content
Question

How to display all the digits of a Long (AKA Int64) Field in Modern UI?

  • February 22, 2026
  • 3 replies
  • 56 views

I’ve got a custom field that is Int64. It’s holding a key value from another application. It’s correctly stored in the DB as 16 digits, but the UI only displays 14. This was the same in Classic UI, but I could force it to use display as a string and all was well (it’s rarely if ever entered by anything than the integration code or an Admin, so digit checking not important.)

I was *hoping* that modern UI would ditch the 14 char limits, but seems like no. How do I make modern UI display all the digits?

Thanks in Advance!

3 replies

Forum|alt.badge.img+3
  • Jr Varsity II
  • February 23, 2026

Hi ​@travisk91 ,

Since this is an external key and not meant for calculations, you should store as Int64 but display as string(non db field). Using this you can display 16 digit

#region UsrExternalKeyDisplay
[PXString(20, IsUnicode = false)]
[PXUIField(DisplayName = "External Key", Enabled = false)]
[PXFormula(typeof(Selector<YourDAC.usrExternalKey, YourDAC.usrExternalKey>))]
public virtual string UsrExternalKeyDisplay
{
    get => UsrExternalKey?.ToString();
    set { }
}
public abstract class usrExternalKeyDisplay : PX.Data.BQL.BqlString.Field<usrExternalKeyDisplay> { }
#endregion
  • Hide the Int64 field on the screen

  • Show the string display field instead

Hope above helps!!


  • Author
  • Freshman I
  • February 23, 2026

Ah, yes, that’s super helpful!

Is there a good workaround for the rare occasion that I need to populate that value from the UI?

Sometimes a value will get out of sync and need attention. Is there a proper method for editing a really big long int?


  • Freshman II
  • March 1, 2026

Hi ​@travisk91 ,

For the rare case where you need to edit the value from the UI, the cleanest approach is to make the string display field editable and write the parsed value back to the underlying Int64 field via the setter:
#region UsrExternalKeyDisplay
[PXString(20, IsUnicode = false)]
[PXUIField(DisplayName = "External Key")]
public virtual string UsrExternalKeyDisplay
{
    get => UsrExternalKey?.ToString();
    set
    {
        if (long.TryParse(value, out long parsed))
            UsrExternalKey = parsed;
    }
}
public abstract class usrExternalKeyDisplay : PX.Data.BQL.BqlString.Field<usrExternalKeyDisplay> { }
#endregion

This way the user types the 16-digit value as a string, and the setter validates and converts it back to Int64 before saving. The actual DB field (UsrExternalKey) remains Int64 — nothing changes in your data model.
A couple of things to keep in mind:

Remove the Enabled = false from PXUIField so the field becomes editable.
Optionally add a PXUIVerify or validation in FieldVerifying to reject non-numeric input and give the user a clean error message.
You can also remove the PXFormula attribute from Rakshanda’s example if needed, since the getter/setter handles the sync directly.

Hope that covers it!