How do i fix this?
# suitescript
l
How do i fix this?
c
It depends what "this" is. What are you doing to generate that?
l
i thought i attached another screenshot but i guess i didnt var PriceChangeDate = new Date();
var FmtChangeDate = format.format({
value: PriceChangeDate, type: format.Type.DATE });
and the field im trying to set is a DATE FIELD so im doing this: item_rec.setValue({ fieldId: 'custitem_last_price_review', value: FmtChangeDate });
c
format.format returns a date string. The record wants a date object. You'll need to use format.parse on the formatted string to get the date object out of it to set on the record.
l
that makes sense. thanks