Skip to main content
Question

Can't use Custom Field within Modern UI Event Handler

  • September 3, 2026
  • 3 replies
  • 29 views

Forum|alt.badge.img+1

I’m trying to follow the examples to change the CSS styling of a row within a grid: I’ve a custom field that gives the quantity allocated on each Sales Order details line and want to change the colour of that line to highlight when it isn’t fully allocated.

So I started with this: UI Events: Changing of the CSS for a Row of a Table • UI Development Guide • Acumatica Beacon

(And added handleEvent, CustomEventType, RowCssHandlerArgs to the import {} from “client-controls” )

	@handleEvent(CustomEventType.GetRowCss, { view: "Transactions" })​
getReceivedRowCss(args: RowCssHandlerArgs<SOLine>): string {​
const split = args?.selector?.row;​

if (split != null && split.UsrQtyAllocated.value < split.UnshippedQty.value) {​
return "bold-row";​
}​
return undefined;​
}​

Where UnshippedQty is a standard field in SOLine. UsrQtyAllocated is defined in (DAC) SOCustomisations.SOLineExt, and in the .ts file as:

export class SOLine_SOCustomisations_generated {
@placeAfterProperty("OrderQty")
UsrQtyAllocated: PXFieldState;
}

 

But I get two compilation errors during publishing:

I think it’s the @handleEvent line that gives the error: 

TS2322: Type 'string' is not assignable to type 'never'

And I also get:

TS2339: Property 'UsrQtyAllocated' does not exist on type 'SOLine'

 

How do I access that custom field?

How do I get around the TS2322 error?

3 replies

darylbowman
Captain II
Forum|alt.badge.img+17

I have this pattern saved for getting an extension where EP307000_PMTimeActivity_DXCrewID is the extension class:

@handleEvent(CustomEventType.RowSelected, { view: "Activity" })
onActivityRowSelected(args: RowSelectedHandlerArgs<PXViewCollection<PMTimeActivity>>) {
const model = args.viewModel as PXViewCollection<EP307000_PMTimeActivity_DXCrewID>;
if (model.SplitRecord) {
model.SplitRecord.enabled = !!args.viewModel.activeRow?.id;
}
}

 


Forum|alt.badge.img+1

Thanks ​@darylbowman, that moves me on somewhat. I now have this:

	@handleEvent(CustomEventType.GetRowCss, { view: "Transactions" })​
getReceivedRowCss(args: RowCssHandlerArgs<SOLine_SOCustomisations_generated>): string {​
const split = args?.selector?.row;​
if (split != null && split.OrderQty.value > split.UnshippedQty.value) {​
return "bold-row";​
}​
return undefined;​
}​

But I still get the other error:

 

 TS2322: Type 'string' is not assignable to type 'never'

darylbowman
Captain II
Forum|alt.badge.img+17

Try this:

@handleEvent(CustomEventType.GetRowCss, { view: "Transactions" })
getReceivedRowCss(args: RowCssHandlerArgs<PXViewCollection<SOLine_SOCustomisations_generated>>): string {
const split = args?.selector?.row;
if (split != null && split.OrderQty.value > split.UnshippedQty.value) {
return "bold-row";
}
return undefined;
}