-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTEMCO_SSU_loftwareprintwsconnection.js
74 lines (64 loc) · 1.91 KB
/
STEMCO_SSU_loftwareprintwsconnection.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* @NApiVersion 2.0
* @NScriptType Suitelet
* @NModuleScope SameAccount
* @Developer Ivan M. Posadas Herrera
* @Email ivanmposadas@gmail.com
* @NApiVersion 2.0
* @Version alpha
*/
define(['N/ui/serverWidget','./STEMCO_SSP_loftwarewsdlimplementation'],
function(ui,wsdl) {
/**
* Definition of the Suitelet script trigger point.
*
* @param {Object} context
* @param {ServerRequest} context.request - Encapsulation of the incoming request
* @param {ServerResponse} context.response - Encapsulation of the Suitelet response
* @Since 2015.2
*/
function onRequest(context) {
var form = ui.createForm({
title: 'Demo Suitelet Print Loftware Form'
});
var subject = form.addField({
id: 'subject',
type: ui.FieldType.TEXT,
label: 'Subject'
});
subject.layoutType = ui.FieldLayoutType.NORMAL;
subject.breakType = ui.FieldBreakType.STARTCOL;
subject.isMandatory = false;
var recipient = form.addField({
id: 'recipient',
type: ui.FieldType.EMAIL,
label: 'Recipient email'
});
recipient.isMandatory = false;
var message = form.addField({
id: 'message',
type: ui.FieldType.TEXTAREA,
label: 'Message'
});
message.displaySize = {
width: 60,
height: 10
};
form.addSubmitButton({
label: 'Send Email'
});
if (context.request.method === 'POST') {
var request = context.request;
var parameters = [];
parameters['QTY'] = 1234;
parameters['SAP_NUM'] = 20589658;
//message.defaultValue = wsdl.getLabelList('','').substring(-1,3000);
var obj = wsdl.getLabelList('','');
message.defaultValue = JSON.stringify(obj[0]);
}
context.response.writePage(form);
}
return {
onRequest: onRequest
};
});