-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathiii_cl_sales_order_performance.js
63 lines (58 loc) · 1.59 KB
/
iii_cl_sales_order_performance.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
/**
* NApiVerson 2.x
* NScriptType ClientScript
*/
define(['N/record'], function(record) {
function loadSalesOrderWithPromise(id) {
record.load.promise({
type: record.Type.SALES_ORDER,
id: id
}).then(function(salesOrder){
var total = salesOrder.getValue('total');
console.log('Promise sales order', total);
});
}
function loadSalesOrder(id){
var salesOrder2 = record.load({
type: record.Type.SALES_ORDER,
id: id
});
var total2 = salesOrder2.getValue('total');
console.log('Non-promise sales order', total2);
}
function pageInit(context) {
loadSalesOrder(517);
loadSalesOrder(518);
loadSalesOrder(520);
loadSalesOrder(521);
loadSalesOrder(522);
loadSalesOrder(523);
loadSalesOrder(524);
loadSalesOrder(526);
loadSalesOrder(527);
loadSalesOrder(528);
loadSalesOrder(530);
loadSalesOrder(531);
loadSalesOrder(532);
loadSalesOrder(533);
loadSalesOrder(534);
// loadSalesOrderWthPromise(517);
// loadSalesOrderWthPromise(518);
// loadSalesOrderWthPromise(520);
// loadSalesOrderWthPromise(521);
// loadSalesOrderWthPromise(522);
// loadSalesOrderWthPromise(523);
// loadSalesOrderWthPromise(524);
// loadSalesOrderWthPromise(526);
// loadSalesOrderWthPromise(527);
// loadSalesOrderWthPromise(528);
// loadSalesOrderWthPromise(530);
// loadSalesOrderWthPromise(531);
// loadSalesOrderWthPromise(532);
// loadSalesOrderWthPromise(533);
// loadSalesOrderWthPromise(534);
}
return {
pageInit: pageInit
}
});