Discusiones
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Obtener la fecha actual utilizando SuiteScript
Se aplica a
Producto: Netsuite 2024.2
Escenario
El siguiente código permitirá al usuario obtener la fecha actual o la fecha actual utilizando SuiteScript. Esto es útil cuando se desea formatear la fecha para personalizar el contenido de formularios impresos, correos electrónicos, etc. Idealmente, esto debería utilizarse como parte de una biblioteca.
Solución
Script de ejemplo:
function DateNow(){
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
var yyyy = today.getFullYear();
today = mm+'/'+dd+'/'+yyyy; // change the format depending on the date format preferences set on your account
return today;
}
Nota: Para agregar el siguiente script a una biblioteca de scripts existente, consulte el artículo SuiteAnswers,
¡Hola, Bienvenido/a!
Para ver los detalles completos, inicia sesión.
¿No tienes una cuenta? ¡Haz clic aquí para comenzar!