Discusiones
Ahora es el momento de pedir a sus amigos y colegas expertos en NetSuite que se unan a la comunidad de soporte de NetSuite. ¡Recomiende ahora! ¡Haga clic aquí por más información!
Actualice su Perfil con su tipo de soporte para obtener la insignia de Tipo de Soporte.
We'd love to hear your thoughts on the Latest updates in the NetSuite Support Community (UI/UX edition) – December 2025. Your feedback is important to us—please let us know what you think or any suggestions you may have in the comments!
Renderice PDF con Suitelet y establezca el nombre del archivo a través de SuiteScript
Se aplica a
Producto: 2020.1
Escenario
Renderice una cadena como PDF y establezca el nombre del archivo cuando lo descargue a través de Suitelet
Solución
Implemente el siguiente código en un Suitelet:
function renderPDF(context){ var serverResponse = context.response; //Gets the response object var testData = 'TEST BODY'; //Test string to be rendered as PDF var filename = 'PurchaseOrder_123456.pdf'; //Sample File name to be set when downloaded serverResponse.setHeader({ name: 'Content-disposition', value: 'filename="' + filename + '"', }); //sets the filename to the specified format or name serverResponse.renderPdf({ xmlString: testData }); //renders the string as a PDF file
return;
}
Notas:
- Los encabezados distinguen entre mayúsculas y minúsculas
Etiquetado:
0
¡Hola, Bienvenido/a!
Iniciar sesión
Para ver los detalles completos, inicia sesión.
Registrarse
¿No tienes una cuenta? ¡Haz clic aquí para comenzar!