headintheclouddev / typings-suitescript-2.0

TypeScript typings for SuiteScript version 2.0
MIT License
145 stars 92 forks source link

Record.setSublistValue(options) #250

Closed keirk closed 1 year ago

keirk commented 1 year ago

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

ShawnTalbert commented 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;
MrRob commented 1 year ago

@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