what does the code for your field look like
# suitescript
b
what does the code for your field look like
n
Copy code
sublist.setSublistValue({
   id: 'custpage_date',
   line: i,
   value: results[i].date
});
b
the code creating the field, not the code setting it
n
Copy code
sublist.addField({
   id: 'custpage_date',
   type: 'DATE',
   label: 'Date'
});
b
thats a Date without time
probably use "5/7/2019" as the value
n
Yes, that's what I am saying that I want to it in a Date field.
This worked:
Copy code
var d = results[i].date.split(' ')[0];
d = nsFormat.format({
   value: d,
   type: 'DATE'
});
a
@NickSuite You should be using ENUM: `
Copy code
serverWidget.FieldType.DATE
`
b
Copy code
results[i].date.split(' ')[0];
alone should work, you dont need to format it
n
@alien4u I am using ENUM. I was just changing things when the code was not working.
Also, @battk I was not able to change the field type to DateTime. Invalid Field Type error is returned.
Copy code
results[i].date.split(' ')[0];
This worked. Thanks
b
DATETIMETZ
n
DATETIME and DATETIMETZ are 2 different field types under serverWidget.FieldType
b
as in use DATETIMETZ instead of DATETIME
n
but why isn't DATETIME type working? Is it a known issue?
b
NetSuite own fields can be DATETIME, the ones you create cannot
netsuite 1
basically the option you choose needs to be in the ss1 listing
n
Oh, ok. Thank you @battk
the list for sublists is slightly different
n
thank you for sharing the links.