Open saulhoward opened 3 months ago
For anyone facing the same problem, I am currently hacking around it with:
if (input.somePicklist === null) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
acc.somePicklist = null as any;
}
I.e., I ignore the TS error, ts-force
sends through the null value, and Salesforce unsets the field as intended.
I would like the option to allow
null
values for PICKLISTs generated byts-force-gen
.When making RestObject Updates, setting fields to
null
tells Salesforce to unset that field:The above code shows a TS error because
ts-force-gen
generated non-nullable enums:ts-force-gen
was run with:I see that all the other generated types are nullable, so perhaps this has been missed? Alternatively, maybe the intended behaviour of
enforcePicklistValues
is to omit nulls. If this is the case, it's a shame as I would like strict enums and nulls.Many thanks for a great library!