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?