Charles.Bastian
04/01/2020, 9:17 PMbattk
04/01/2020, 9:18 PMCharles.Bastian
04/01/2020, 9:19 PMbattk
04/01/2020, 9:19 PMCharles.Bastian
04/01/2020, 9:20 PMCharles.Bastian
04/01/2020, 10:02 PMbattk
04/01/2020, 10:05 PMCharles.Bastian
04/01/2020, 10:07 PMCharles.Bastian
04/01/2020, 10:11 PMbattk
04/01/2020, 10:15 PMbattk
04/01/2020, 10:15 PMCharles.Bastian
04/01/2020, 10:15 PMbattk
04/01/2020, 10:16 PMCharles.Bastian
04/01/2020, 10:16 PMbattk
04/01/2020, 10:16 PMbattk
04/01/2020, 10:17 PMCharles.Bastian
04/01/2020, 10:17 PMCharles.Bastian
04/01/2020, 10:22 PMCharles.Bastian
04/01/2020, 10:34 PMbattk
04/01/2020, 10:37 PM/**
*@NApiVersion 2.0
*@NScriptType Suitelet
*/
define(["N/ui/serverWidget", "N/file"], function (serverWidget, file) {
return {
onRequest: function (context) {
if (context.request.parameters.download === "T") {
context.response.writeFile({
file: file.create({
name: "Testing.csv",
fileType: file.Type.CSV,
contents: "blahblahj\nblahblah",
encoding: file.Encoding.UTF8,
}),
});
} else {
var battkWroteThis = serverWidget.createForm({
title: "Battk chose my title",
});
battkWroteThis.addButton({
id: "battk_button",
label: "Battk Says click me",
functionName: 'window.open(window.location.href + "&download=T")',
});
context.response.writePage({ pageObject: battkWroteThis });
}
},
};
});
battk
04/01/2020, 10:39 PMCharles.Bastian
04/02/2020, 1:26 PMCharles.Bastian
04/02/2020, 2:11 PM