Trying to set a time of day field but can't seem t...
# suitescript
n
Trying to set a time of day field but can't seem to get it to work.
b
share the code, general advice is to use setValue with a Date and setText with the string
n
@battk format.parse({ value : scriptContext.request.parameters.proposalduetime, type : format.Type.TIMEOFDAY})
that is what I am using to set the value
b
what is the value of
scriptContext.request.parameters.proposalduetime
when parsing using N/format, the input needs to already be in a netsuite formatted string
and will output the input if it is not
n
this is what my input field is outputing before using format.parse
16:45
b
if you are sure thats the correct format for the current user
you can use
Copy code
myRecord.setText({ fieldId: "custbody_rfpproposalduetime", text: "16:45" });
or
Copy code
myRecord.setValue({
  fieldId: "custbody_rfpproposalduetime",
  value: format.parse({
    value: "16:45",
    type: format.Type.TIMEOFDAY,
  }),
});
n
Thanks that worked