-
Notifications
You must be signed in to change notification settings - Fork 8
/
executionContext.js
428 lines (389 loc) · 10.7 KB
/
executionContext.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/**
* SuiteScript Execution Context APIs
*
* Context APIs are used to get system information or metadata about a script that is running,
* a user in a NetSuite account, or certain settings that have been applied to account.
*/
/**
* Return context information about the current user/script
*
* @return {nlobjContext}
* @since 2007.0
*/
function nlapiGetContext() {
}
/**
* Return the internal ID for the currently logged in user.
* Returns -4 when called from online forms or "Available without Login" Suitelets
*
* @return {int}
* @since 2005.0
*/
function nlapiGetUser() {
}
/**
* Return the internal ID for the current user's role.
* Returns 31 (Online Form User) when called from online forms or "Available without Login" Suitelets
*
* @return {int}
* @since 2005.0
*/
function nlapiGetRole() {
}
/**
* Return the internal ID for the current user's department
*
* @return {int}
* @since 2005.0
*/
function nlapiGetDepartment() {
}
/**
* Return the internal ID for the current user's location
*
* @return {int}
* @since 2005.0
*/
function nlapiGetLocation() {
}
/**
* Return the internal ID for the current user's subsidiary
*
* @return {int}
* @since 2008.1
*/
function nlapiGetSubsidiary() {
}
/**
* Create an entry in the script execution log (note that execution log entries are automatically purged after 30 days)
*
* @param {string} type One of the following log types:
* • DEBUG
* • AUDIT
* • ERROR
* • EMERGENCY
* @param {string} title log title (up to 90 characters supported)
* @param {string} [details] log details (up to 3000 characters supported)
*
* @return {void}
* @since 2008.1
*/
function nlapiLogExecution(type, title, details) {
}
/**
* Utility class providing information about the current user and the script runtime
* Return a new instance of nlobjContext used for user and script context information
*
* @constructor
*/
function nlobjContext() {
}
/**
* Return the name of the current user
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getName = function() {
};
/**
* Return the internalId of the current user
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getUser = function() {
};
/**
* Return the internalId of the current user's role
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getRole = function() {
};
/**
* Return the script ID of the current user's role
*
* @return {string}
* @since 2008.2
*/
nlobjContext.prototype.getRoleId = function() {
};
/**
* Return the internalId of the current user's center type
*
* @return {string}
* @since 2008.2
*/
nlobjContext.prototype.getRoleCenter = function() {
};
/**
* Return the email address of the current user
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getEmail = function() {
};
/**
* Return the internal ID of the contact logged in on behalf of a customer, vendor, or partner
* It returns -1 for non-contact logins
*
* @return {int}
* @since 2009.1
*/
nlobjContext.prototype.getContact = function() {
};
/**
* Return the account ID of the current user
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getCompany = function() {
};
/**
* Return the internalId of the current user's department
*
* @return {int}
* @since 2007.0
*/
nlobjContext.prototype.getDepartment = function() {
};
/**
* Return the internalId of the current user's location
*
* @return {int}
* @since 2007.0
*/
nlobjContext.prototype.getLocation = function() {
};
/**
* Return the internalId of the current user's subsidiary
*
* @return {int}
* @since 2007.0
*/
nlobjContext.prototype.getSubsidiary = function() {
};
/**
* Return the execution context for this script, one of:
* • userinterface - Client SuiteScript or user event triggers invoked from the UI
* • webservices - User event triggers invoked from webservice calls
* • csvimport - User event triggers invoked during CSV imports
* • smbxml - User event triggers invoked during SMBXML calls
* • portlet - Portlet script or user event triggers invoked via portlet scripts
* • scheduled - Scheduled script or user event triggers invoked via scheduled scripts
* • suitelet - Suitelet or user event triggers invoked via suitelets
* • custommassupdate - Mass update script triggers invoked via custom Mass Update scripts
* • workflow - Workflow action script triggers invoked via Workflow Action scripts
* • webstore - User event triggers invoked from the web store (for example to determine if sales
* orders or customers were created in the web store).
* • userevent - This context type represents cases in which records are generated in the backend
* (as opposed to being generated by the UI). For example, the 'userevent' context
* distinguishes the case wherein a Bill Payment is submitted as part of a non- record page.
* Whereas the 'userinterface' context identifies when a single Bill Payement record
* is submitted from the UI.
*
* @return {string}
* @since 2007.0
*/
nlobjContext.prototype.getExecutionContext = function() {
};
/**
* Return the amount of usage units remaining for this script
*
* @return {int}
* @since 2007.0
*/
nlobjContext.prototype.getRemainingUsage = function() {
};
/**
* Return true if feature is enabled, false otherwise
*
* @param {string} name
*
* @return {boolean} Returns true if a feature is enabled in the current account
* @since 2009.2
*/
nlobjContext.prototype.getFeature = function(name) {
};
/**
* Return current user's permission level (0-4) for this permission
*
* @param {string} name
*
* @return {int}
* @since 2009.2
*/
nlobjContext.prototype.getPermission = function(name) {
};
/**
* Return system or script preference selection for current user
*
* @param {string} name
*
* @return {string}
* @since 2009.2
*/
nlobjContext.prototype.getPreference = function(name) {
};
/**
* Return value of session object set by script
*
* @param {string} name
*
* @return {string}
* @since 2009.2
*/
nlobjContext.prototype.getSessionObject = function(name) {
};
/**
* Set the value of a session object using a key
*
* @param {string} name
* @param {string} value
*
* @return {void}
* @since 2009.2
*/
nlobjContext.prototype.setSessionObject = function(name, value) {
};
/**
* Return an array containing the names of all keys used to set session objects
*
* @return {string[]}
* @since 2009.2
*/
nlobjContext.prototype.getAllSessionObjects = function() {
};
/**
* Return the NetSuite version for the current account
*
* @return {string}
* @since 2009.2
*/
nlobjContext.prototype.getVersion = function() {
};
/**
* @return {string} The environment that the script is executing in: SANDBOX, PRODUCTION, BETA, INTERNAL
* @since 2008.2
*/
nlobjContext.prototype.getEnvironment = function() {
};
/**
* Return the logging level for the current script execution. Not supported in CLIENT scripts
*
* @return {string}
* @since 2008.2
*/
nlobjContext.prototype.getLogLevel = function() {
};
/**
* Return the script ID for the current script
*
* @return {string}
* @since 2009.2
*/
nlobjContext.prototype.getScriptId = function() {
};
/**
* Return the deployment ID for the current script
*
* @return {string}
* @since 2009.2
*/
nlobjContext.prototype.getDeploymentId = function() {
};
/**
* Return the % complete specified for the current scheduled script execution
*
* @return {int}
* @since 2009.2
*/
nlobjContext.prototype.getPercentComplete = function() {
};
/**
* Set the % complete for the current scheduled script execution
*
* @param {number} percent the percentage of records completed
* @return {void}
* @since 2009.2
*/
nlobjContext.prototype.setPercentComplete = function(percent) {
};
/**
* Return a system/script setting. Types are SCRIPT, SESSION, FEATURE, PERMISSION
*
* Note that if you want to get session, feature, or permission settings directly,
* this method should be considered deprecated, use getFeature(), getPermission() or getSessionObject instead
*
* @param {string} type
* @param {string} name
*
* @return {string|int} If type is specified as SCRIPT, SESSION, or FEATURE, a string value is returned
* If type is specified as PERMISSION, an integer value is returned
* @since 2007.0
* @see getFeature
* @see getPermission
* @see getSessionObject
*/
nlobjContext.prototype.getSetting = function(type, name) {
};
/**
* Set a system/script setting. Only supported type is SESSION
*
* @param {string} type
* @param {string} name
* @param {string} value
*
* @return {void}
* @since 2007.0
* @see setSessionObject
* @deprecated Use setSessionObject() instead
*/
nlobjContext.prototype.setSetting = function(type, name, value) {
};
/**
* Return an Object containing name/value pairs of color groups to their corresponding
* RGB hex color based on the currently logged in user's color them preferences.
*
* Note: NetSuite color themes are read-only.
*
* The following table provides the names of available NetSuite color theme attributes
* and a description of what each attribute affects.
*
* Attribute Description
* -----------------------|---------------------------------------------------------------------
* buttonbackground Background color of colored buttons
* text Text color for all text on the page body
* portlet Portlet trim (header background) color
* portletlabel Text in portlet heading
* crumbtext Text color of breadcrumbs on the header bar (color may be synthesized by page looks)
* inactivetab Inactive tab color
* link Text color for all links on the page bodySuiteScript Objects
* backgroundrequiredfld Background color for required fields in entry forms
* inactivetextontab Text color on the inactive tab
* textontab Text color on the active tab
* bodybackground Page background color
* headbackground Page header area background color
* shadedbackground Shaded area background color
* headerbar Header bar color
* shadedborder Border/header color around shaded areas
* activetab Active tab color
*
* @return {Object}
* @since 2010.1
* @deprecated 2014.2
*/
nlobjContext.prototype.getColorPreferences = function() {
};
/**
* Return the runtime version of SuiteScript, could be 1.0 or 2.0
*
* @return {Object}
* @since 2014.1
*/
nlobjContext.prototype.getRuntimeVersion = function() {
};