PF
08/27/2024, 10:29 PMCeligo AI
08/27/2024, 10:29 PMAI generated answer (using internal Slack threads):****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ****** The issue you're experiencing with the date discrepancy between the message table and NetSuite through the connector is likely due to timezone differences. When you're storing a date in NetSuite, it's stored in the Pacific Standard Time (PST) timezone by default. If your system's timezone is different, this can cause a day's difference when the date is retrieved. To fix this, you need to handle the timezone before setting the date in the field. When you're creating a new Date object in JavaScript, if you don't specify a timezone, it assumes UTC. So, when you're setting the date, you should include the timezone information in the date constructor. Here's an example of how you can do this:
javascript
var dateStr = "2023-06-05T19:00:000+2:00"; // CET timezone
var dateObj = new Date(dateStr);
rec.setValue({fieldId: "custrecord_date", value: dateObj});
In this example, 2023-06-05T19:00:000+2:00
represents the date in the Central European Time (CET) timezone. When this date is stored in NetSuite, it will be converted to Pacific Time.
However, please note that this solution might not work for all hours of the day due to the timezone difference between CET and PST. You might need to adjust the time in your date string accordingly to ensure the date remains correct after the conversion.
Also, remember that the user's NetSuite timezone is irrelevant for normal date fields. The date is always stored in PST in NetSuite, regardless of the user's timezone settings.Celigo AI
08/27/2024, 10:30 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837150812
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83545512
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.829553664
Celigo AI
08/27/2024, 10:30 PM