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
  • 95 views

View & DAC

 public PXFilter<TestViewDAC> TestView;

 [Serializable]
 public class TestViewDAC : PXBqlTable, IBqlTable
 {
     #region 
     [PXDBDecimal(2)]
     [PXDefault(TypeCode.Decimal, "0.00", PersistingCheck = PXPersistingCheck.Nothing)]
     [PXUIField(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)]
     [PXUIField(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.

 

Best answer by mehdihasanov

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>;
}

 

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

1 reply

mehdihasanov
Acumatica Employee
  • Acumatica Employee
  • 8 replies
  • Answer
  • August 19, 2024

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


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