I'm noticing that custom field types that are checkboxes are inconsistent in terms of how they accept or read values:
For example, on a custom record, if I have a custom field "custrecord_mycheckbox" setup as a checkbox, then 2.0 says I must set this (and assume read) as a boolean:
record.setValue({fieldId: "custrecord_mycheckbox", value: true});
and
record.getValue({fieldId: "custrecord_mycheckbox"}); returns true or false
If I attempt to do set this using 'T' or 'F' like with 1.0 methods, I get this error:
You have entered an Invalid Field Value T for the following field: custrecord_mycheckbox
However, if I add a dynamic field in beforeLoad to the record "custpage_mycheckbox" and type it as a checkbox, and I try and set the defaultValue using boolean, I get this error:
{"type":"error.SuiteScriptError","name":"INVALID_F LD_VALUE","message":"You have entered an Invalid Field Value true for the following field: custpage_mycheckbox"
When I attempt to set the dynamic field using setValue with a boolean, nothing happens (no error). However, when I read the dynamic field:
record.getValue({fieldId: "custpage_mycheckbox"}); it returns string T or F (not true or false)
Appears that dynamic fields of type checkbox expect a 'T' or an 'F' (like 1.0 API methods) and NOT a boolean.
This is incredibly inconsistent between fields of the same type not to mention error prone. Would probably be best to make these consistent.