Closed keirk closed 1 year ago
Are you perhaps on a very old version of typings-suitescript?
The current definition for SetSublistValueOptions defines value
as type FieldValue
which is defined as
export type FieldValue = Date | number | number[] | string | string[] | boolean | null;
@keirk I see the confusion here. From the record module, you are correct, you can set a sublist value with a string, number, date, etc. However, the interface you mentioned is from the N/ui/serverWidget module. In the context of creating a sublist on a form, you can only set string values. See: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_456052185058.html
https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4273166777.html
According to the docs the options.value should be number | Date | string | array | boolean, but SublistSetSublistValueOptions.value is string
interface SublistSetSublistValueOptions { /** The internal ID name of the line item field being set. */ id: string; /** The line number for this field (starts at 0). */ line: number; /** The value for the field being set. */ value: string; }