Mark
05/08/2025, 7:18 PMCeligo AI
05/08/2025, 7:18 PMAI generated answer (using internal Slack threads):To create a calendar event via SuiteScript, you would use the
Event
module. You can set the date for the event using the setValue
method with a Date
instance. If you want to use a string instead, you can use the setText
method. If you need to convert a Date
into a string, you can use the N/format
module.
For setting the time of an event, you can use the setValue
method with a Date
instance that has the time of day you want. The starttime
field is a Time field and requires a Date
instance for the value.
Here is an example of how you might set the date and time for an event:
javascript
var event = record.create({type: record.Type.CALENDAR_EVENT});
event.setValue({
fieldId: 'startdate',
value: new Date('2020-11-19')
});
var startTime = new Date();
startTime.setHours(9, 0, 0, 0);
event.setValue({
fieldId: 'starttime',
value: startTime
});
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/08/2025, 7:18 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.831326962
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.807433486
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.805391729
Celigo AI
05/08/2025, 7:18 PM