mescalante
04/06/2026, 5:48 PMCeligo AI
04/06/2026, 5:48 PMAI generated answer (using internal Slack threads):To exclude weekends from the cycle count dates, you can use a formula in your search or script that checks the day of the week for each date and excludes Saturdays and Sundays. In SuiteScript, you can use the
getDay() method of the Date object to get the day of the week. Here's a basic example:
javascript
var date = new Date();
var dayOfWeek = date.getDay();
if (dayOfWeek != 0 && dayOfWeek != 6) {
// It's a weekday
}
In this example, getDay() returns a number from 0 (Sunday) to 6 (Saturday). If the day of the week is not 0 or 6, it's a weekday.
In a saved search, you can use the TO_CHAR function to get the day of the week, and then exclude Saturdays and Sundays. Here's an example of how you might do this in the Formula (Numeric) field of a search:
CASE WHEN TO_CHAR({date},'D') = '1' OR TO_CHAR({date},'D') = '7' THEN 0 ELSE 1 END
In this example, TO_CHAR({date},'D') returns a number from 1 (Sunday) to 7 (Saturday). If the day of the week is 1 or 7, the formula returns 0; otherwise, it returns 1. You can then filter your search results to exclude rows where this formula returns 0.
******
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
04/06/2026, 5:48 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823425353
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.82220459
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.817626953
Celigo AI
04/06/2026, 5:48 PM