https://netsuiteprofessionals.com logo
j

jen

05/02/2022, 11:31 PM
am having blonde moment. Why when I try nlapiGetFieldValue(‘name’); on a custom record that definitely has a name field with a value in it, am I getting “null”?
b

Brandon

05/03/2022, 12:04 AM
If the field is restricted it could return 'null'. Have you checked the settings for the field?
n

NElliott

05/03/2022, 7:53 AM
@jen If it's beforeSubmit you'd get away with what you used otherwise my money is on you need: <recordObject>.getFieldValue('name');
j

jen

05/03/2022, 3:29 PM
I’m just trying in teh console
<recordObject>.getFieldValue(‘name’); also gives null
I was actually trying first with
var rec = currentRecord.get(); rec.getValue({fieldId: 'name'});
in console
n

NElliott

05/03/2022, 5:18 PM
Ah so, nlapiGetValue in the console, should work if the record is in edit mode and visible via the UI (IE on the form). I'd also try assigning it to a variable and check the variable, seen weird inconsistency just getting the value...