Skip to main content
Solved

I defined a simple View on the PX.Objects.AR.ARPaymentEntry page. This View contains two custom fields. But why can't they be displayed on Modern UI?

  • 27 May 2024
  • 1 reply
  • 78 views

View & DAC

 public PXFilter<TestViewDAC> TestView;

 ÂSerializable]
 public class TestViewDAC : PXBqlTable, IBqlTable
 {
     #region 
      PXDBDecimal(2)]
          gPXUIField(DisplayName = "Test Total", Required = false)]
     public decimal? UsrTestTotal { get; set; }
     public abstract class usrTestTotal : PX.Data.BQL.BqlDecimal.Field<usrTestTotal> { }
     #endregion

     #region  
     >PXDBDecimal(2)]
      PXDefault(TypeCode.Decimal, "0.00", PersistingCheck = PXPersistingCheck.Nothing)]
     PPXUIField(DisplayName = "Test Amount", Required = false)]
     public decimal? UsrTestAmount { get; set; }
     public abstract class usrTestAmount : PX.Data.BQL.BqlDecimal.Field<usrTestAmount> { }
     #endregion

 }

 

TS Codes:

 

 

Html Codes:

 

 

The compiled UI is not displayed, but the UI settings are gray.

 

What you want to do is rename the PXView class, as long as it’s not the same as your view name. You can name it anything you want, but the standard is to use the associated DAC name.

export class AR302000 extends PXScreen {
...
TestView = createSingle(TestViewDAC);
...
}

export class TestViewDAC extends PXView {
UsrTestTotal: PXFieldState<PXFieldOptions.Readonly>;
UsrTestAmount: PXFieldState<PXFieldOptions.Readonly>;
}

But it would be even better if you create a new extension file in an extension folder where you extend the screen and then export.

export interface AR302000_ExtensionName extends AR302000 {}
export class AR302000_ExtensionName {
TestView = createSingle(TestViewDAC);
}

export class TestViewDAC extends PXView {
UsrTestTotal: PXFieldState<PXFieldOptions.Readonly>;
UsrTestAmount: PXFieldState<PXFieldOptions.Readonly>;
}

 


Reply