-
Notifications
You must be signed in to change notification settings - Fork 93
/
SuiteScriptV1.d.ts
3525 lines (3474 loc) · 142 KB
/
SuiteScriptV1.d.ts
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
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/** UI Object page type used to build multi-step "assistant" pages to simplify complex workflows. All data and state for an assistant is tracked automatically throughout the user's session up until completion of the assistant. */
interface NLObjAssistant {
/**
* Add a field to this page and return it.
* @param {string} name field name
* @param {string} type field type
* @param {string} label field label
* @param {number|string} source script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields
* @param {string} group group name that this field will live on. If empty then the field is added to the main section of the page
*/
addField(name: string, type: string, label?: string, source?: number|string, group?: string): NLObjField;
/**
* Add a field group to the page.
* @param {string} name field group name
* @param {string} label field group label
*/
addFieldGroup(name: string, label: string): NLObjFieldGroup;
/**
* Add a step to the assistant.
* @param {string} name the name of the step
* @param {string} label label used for this step
*/
addStep(name: string, label: string): NLObjAssistantStep;
/**
* Add a sublist to this page and return it. For now only sublists of type inlineeditor are supported
* @param {string} name sublist name
* @param {string} type sublist type (inlineeditor only for now)
* @param {string} label sublist label
*/
addSubList(name: string, type: string, label: string): NLObjSubList;
/**
* Return an array of the names of all field groups on this page.
*/
getAllFieldGroups(): string[];
/**
* Return an array of the names of all fields on this page.
*/
getAllFields(): string[];
/**
* Return an array of all the assistant steps for this assistant.
*/
getAllSteps(): NLObjAssistantStep[];
/**
* Return an array of the names of all sublists on this page .
*/
getAllSubLists(): string[];
/**
* Return current step set via nlobjAssistant.setCurrentStep(step)
*/
getCurrentStep(): NLObjAssistantStep;
/**
* Return a field on this page.
* @param {string} name field name
*/
getField(name: string): NLObjField;
/**
* Return a field group on this page.
* @param {string} name field group name
*/
getFieldGroup(name: string): NLObjFieldGroup;
/**
* Return the last submitted action by the user: next|back|cancel|finish|jump
*/
getLastAction(): string;
/**
* Return step from which the last submitted action came from
*/
getLastStep(): NLObjAssistantStep;
/**
* Return the next logical step corresponding to the user's last submitted action. You should only call this after
* you have successfully captured all the information from the last step and are ready to move on to the next step. You
* would use the return value to set the current step prior to continuing.
*/
getNextStep(): NLObjAssistantStep;
/**
* Return an assistant step on this page.
* @param {string} name step name
*/
getStep(name: string): NLObjAssistantStep;
/**
* Return the total number of steps in the assistant.
*/
getStepCount(): number;
/**
* Return a sublist on this page.
* @param {string} name sublist name
*/
getSubList(name: string): NLObjSubList;
/**
* Return true if the assistant has an error message to display for the current step.
*/
hasError(): boolean;
/**
* Return true if all the steps have been completed.
*/
isFinished(): boolean;
/**
* Redirect the user following a user submit operation. Use this to automatically redirect the user to the next logical step.
* @param {NLObjResponse} response The response object used to communicate back to the user's client
*/
sendRedirect(response: NLObjResponse): void;
/**
* Mark a step as current. It will be highlighted accordingly when the page is displayed
* @param {NLObjAssistantStep} step Assistant step object representing the current step that the user is on.
*/
setCurrentStep(step: NLObjAssistantStep): void;
/**
* Set the error message for the current step.
* @param {string} html Error message (rich text) to display on the page to the user.
*/
setError(html: string): void;
/**
* Set the values for all the fields on this page.
* @param {Object} values Object of field name/value pairs used to set all fields on page.
*/
setFieldValues(values: Object): void;
/**
* Mark assistant page as completed and optionally set the rich text to display on completed page.
* @param {string} html Completion message (rich text) to display on the "Finish" page.
*/
setFinished(html: string): void;
/**
* If numbered, step numbers are displayed next to the step's label in the navigation area.
* @param {boolean} numbered If true (default assistant behavior) step numbers will be displayed next to the step label.
*/
setNumbered(numbered: boolean): void;
/**
* If ordered, steps are show on left and must be completed sequentially, otherwise steps are shown on top and can be done in any order
* @param {boolean} ordered If true (default assistant behavior) then a navigation order thru the steps/pages will be imposed on the user. Otherwise the user will be allowed to navigate across steps/pages in any order they choose.
*/
setOrdered(ordered: boolean): void;
/**
* Set the script ID for Client Script used for this form.
* @param {string|number} script Script ID or internal ID for global client script used to enable Client SuiteScript on page.
*/
setScript(script: string|number): void;
/**
* Show/hide shortcut link. Always hidden on external pages.
* @param {boolean} show Enable/disable "Add To Shortcut" link on this page.
*/
setShortcut(show: boolean): void;
/**
* Set the splash screen used for this page.
* @param {string} title splash portlet title
* @param {string} text1 splash portlet content (left side)
* @param {string} text2 splash portlet content (right side)
*/
setSplash(title: string, text1: string, text2?: string): void;
/**
* Set the page title.
* @param {string} title
*/
setTitle(title: string): void;
}
/** Assistant Step Definition. Used to define individual steps/pages in multi-step workflows. */
interface NLObjAssistantStep {
/**
* Return an array of the names of all fields entered by the user during this step.
*/
getAllFields(): string[];
/**
* Return an array of the names of all sublist fields entered by the user during this step
* @param {string} group sublist name
*/
getAllLineItemFields(group: string): string[];
/**
* Return an array of the names of all sublists entered by the user during this step.
*/
getAllLineItems(): string[];
/**
* Return the value of a field entered by the user during this step.
* @param {string} name field name
*/
getFieldValue(name: string): string;
/**
* Return the selected values of a multi-select field as an Array entered by the user during this step.
* @param {string} name multi-select field name
*/
getFieldValues(name: string): string[];
/**
* Return the number of lines previously entered by the user in this step (or -1 if the sublist does not exist).
* @param {string} group sublist name
*/
getLineItemCount(group: string): number;
/**
* Return the value of a sublist field entered by the user during this step.
* @param {string} group sublist name
* @param {string} name sublist field name
* @param {number} line sublist (1-based)
*/
getLineItemValue(group: string, name: string, line: number): string;
/**
* Return the index of this step in the assistant page (1-based).
*/
getStepNumber(): number;
/**
* Set helper text for this assistant step.
* @param {string} help inline help text to display on assistant page for this step
*/
setHelpText(help: string): NLObjAssistantStep
/**
* Set the label for this assistant step.
* @param {string} label display label used for this assistant step
*/
setLabel(label: string): void;
}
/** Buttons used for triggering custom behaviors on pages. */
interface NLObjButton {
/**
* Disable or enable button.
* @param {boolean} disabled If true then this button should be disabled on the page.
*/
setDisabled(disabled: boolean): NLObjButton;
/**
* Set the label for this button.
* @param {string} label display label for button
*/
setLabel(label: string): NLObjButton;
/**
* Sets the button as hidden in the UI. This API is supported on custom buttons and on some standard NetSuite buttons
* @param {boolean} visible Defaults to true if not set. If set to false, the button will be hidden in the UI.
*/
setVisible(visible: boolean): NLObjButton;
}
interface NLObjCache {
get(key: string): string;
/**
* @param {string} key
* @param {string} value
* @param {number} ttl, time to live in seconds.
*/
put(key: string, value: string, ttl: number): Object;
remove(key: string): Object;
}
/** For columns used on scriptable lists and list portlets. */
interface NLObjColumn {
/**
* Add a URL parameter (optionally defined per row) to this column's URL.
*
* @param {string} param the name of a parameter to add to URL
* @param {string} value the value of the parameter to add to URL -or- a column in the datasource that returns the parameter value for each row
* @param {boolean} perRow if true then the 2nd arg is expected to be a column in the datasource
*/
addParamToURL(param: string, value: string, perRow?: boolean): void;
/**
* Set the header name for this column.
*
* @param {string} label The label for this column.
*/
setLabel(label: string): void;
/**
* Set the base URL (optionally defined per row) for this column.
*
* @param {string} value the base URL or a column in the datasource that returns the base URL for each row
* @param {boolean} perRow if true then the 1st arg is expected to be a column in the datasource
*/
setURL(value: string, perRow?: boolean): void;
}
/** For interacting with setup/configuration pages. */
interface NLObjConfiguration {
/**
* Return an Array of all field names on the record.
*/
getAllFields(): string[];
/**
* Return the type corresponding to this setup record.
*/
getType(): string;
/**
* Return field metadata for field.
*
* @param {string} fldnam field name
*/
getField(fldnam: string): NLObjField;
/**
* Return the text value of a field.
* @restriction only supported for select fields
*
* @param {string} name field name
*/
getFieldText(name: string): string;
/**
* Return the selected text values of a multi-select field as an Array.
* @param {string} name field name
*/
getFieldTexts(name: string): string[];
/**
* Return the value of a field.
*
* @param {string} name field name
*/
getFieldValue(name: string): string;
/**
* Return the selected values of a multi-select field as an Array.
* @restriction only supported for multi-select fields
*
* @param {string} name field name
*/
getFieldValues(name: string): string[];
/**
* Set the value of a field.
*
* @param {string} name field name
* @param {string} value field value
*/
setFieldValue(name: string, value: string): void;
/**
* Set the values of a multi-select field.
* @restriction only supported for multi-select fields
*
* @param {string} name field name
* @param {string[]} values field values
*/
setFieldValues(name: string, values: string[]): void;
/**
* Set the value (via display value) of a field.
* @restriction only supported for select fields
*
* @param {string} name field name
* @param {string} text field display text
*/
setFieldText(name: string, text: string): void;
/**
* Set the values (via display values) of a multi-select field.
* @restriction only supported for multi-select fields
*
* @param {string} name Field name.
* @param {string[]} texts Array of field display text values.
*/
setFieldTexts(name: string, texts: string[]): void;
}
/** Utility class providing information about the current user and the script runtime. */
interface NLObjContext {
/**
* Return the account ID of the current user.
*/
getCompany(): string;
/**
* Return the deployment ID for the current script.
*/
getDeploymentId(): string;
/**
* Return the internalId of the current user's department.
*/
getDepartment(): number;
/**
* Return the email address of the current user.
*/
getEmail(): string;
/**
* Return the environment that the script is executing in: SANDBOX, PRODUCTION, BETA, INTERNAL.
*/
getEnvironment(): string;
/**
* Return the execution context for this script: webServices|csvImport|client|userInterface|scheduledScript|portlet|suitelet|debugger|custommassupdate
*/
getExecutionContext(): string;
/**
* Return true if feature is enabled, false otherwise.
* @param {string} name
*/
getFeature(name: string): boolean;
/**
* Return the internalId of the current user's location.
*/
getLocation(): number;
/**
* Return the logging level for the current script execution. Not supported in CLIENT scripts.
*/
getLogLevel(): string;
/**
* Return the name of the current user.
*/
getName(): string;
/**
* Return the % complete specified for the current scheduled script execution.
*/
getPercentComplete(): number;
/**
* Return current user's permission level (0-4) for this permission.
* @param {string} name
*/
getPermission(name: string): number;
/**
* Return system or script preference selection for current user.
* @param {string} name
*/
getPreference(name: string): string;
/**
* Returns the number of scheduled script queues in a given account.
*/
getQueueCount(): number;
/**
* Return the amount of usage units remaining for this script.
*/
getRemainingUsage(): number;
/**
* Return the internalId of the current user's role.
*/
getRole(): string;
/**
* Return the internalId of the current user's center type.
*/
getRoleCenter(): string;
/**
* Return the script ID of the current user's role.
*/
getRoleId(): string;
/**
* Return the script ID for the current script.
*/
getScriptId(): string;
/**
* Return value of session object set by script.
* @param {string} name
*/
getSessionObject(name: string): string;
/**
* Return a system/script setting. Types are SCRIPT, SESSION, FEATURE, PERMISSION.
*
* @param {string} type
* @param {string} name
*
*/
getSetting(type: string, name: string): string;
/**
* Return the internalId of the current user's subsidiary.
*/
getSubsidiary(): number;
/**
* Return the internalId of the current user.
*/
getUser(): string;
/**
* Return the NetSuite version for the current account.
*/
getVersion(): string;
/**
* Set the % complete for the current scheduled script execution.
* @param {number} pct The percentage of records completed
*/
setPercentComplete(pct: number): void;
/**
* Set the value of a session object using a key.
* @param {string} name
* @param {string} value
*/
setSessionObject(name: string, value: string): void;
/**
* Set a system/script setting. Only supported type is SESSION.
*
* @param {string} type
* @param {string} name
* @param {string} value
*
* @deprecated
*/
setSetting(type: string, name: string, value: string): void;
}
/**
* Return a new instance of nlobjCredentialBuilder
*
* @classDescription The nlobjCredentialBuilder object encapsulates a request string that can be passed to nlapiRequestURLWithCredentials(credentials, url, postdata, headers, httpsMethod).
* @param {string} request can include an embedded GUID (globally unique string).
* @param {string} domain URL’s host name. Host name must exactly match the host name in your URL.
*
* @constructor
*/
declare function nlobjCredentialBuilder(request: string, domain: string): NLObjCredentialBuilder;
interface NLObjCredentialBuilder {
/**
* Appends a passed in string to an nlobjCredentialBuilder object.
*
* @param {string} string String to be appended.
*/
append(string: string): NLObjCredentialBuilder;
/**
* Encodes an nlobjCredentialBuilder object per the base64 scheme.
*/
base64(): NLObjCredentialBuilder;
/**
* Hashes an nlobjCredentialBuilder object with the MD5 hash function.
*/
md5(): NLObjCredentialBuilder;
/**
* Replaces all instances of string1 with string2.
*
* @param {string} string1 String to be replaced
* @param {string} string2 String to be replaced with
*/
replace(string1: string, string2: string): NLObjCredentialBuilder;
/**
* Hashes an nlobjCredentialBuilder object with the SHA-256 hash function.
*/
sha256(): NLObjCredentialBuilder;
/**
* Encodes an nlobjCredentialBuilder object per the UTF-8 scheme.
*/
utf8(): NLObjCredentialBuilder;
}
interface NLObjCSVImport {
/**
* Sets the data to be imported in a linked file for a multi-file import job, by referencing a file in the file cabinet using nlapiLoadFile(id), or by inputting CSV data as raw string.
*
* @param {string} sublist The internal ID of the record sublist for which data is being imported.
* @param {string|NLObjFile} file Raw data or nlobjFile object containing CSV data.
*/
setLinkedFile(sublist: string, file: string|NLObjFile): NLObjCSVImport;
/**
* Sets the name of the saved import map to be used for an import, by referencing the internal ID or script ID of the import map.
*
* @param {string} savedImport The internal ID or script ID of the saved mapping to use for the import job.
*/
setMapping(savedImport: string): void;
/**
* Sets the name of the saved import map to be used for an import, by referencing the internal ID or script ID of the import map.
*
* @param {string} option The name of the option; in this case, jobName.
* @param {string} value The value for the jobName option, meaning the text to be displayed in the Job Name column at Setup > Import/Export > View CSV Import Status.
*/
setOption(option: string, value: string): void;
/**
* Sets the data to be imported in the primary file for an import job, by referencing a file in the file cabinet using nlapiLoadFile, or by inputting CSV data as raw string.
*
* @param {string|NLObjFile} file Raw data or nlobjFile object containing CSV data.
*/
setPrimaryFile(file: string|NLObjFile): void;
/**
* Sets the data to be imported in the primary file for an import job, by referencing a file in the file cabinet using nlapiLoadFile, or by inputting CSV data as raw string.
*
* @param {string} queue The new queue number. Valid values range from '1' to '5', depending upon the SuiteCloud License.
*/
setQueue(queue: string): void;
}
interface NLObjDuplicateJobRequest {
setEntityType(entityType: string): void;
setMasterId(masterID: string): void;
setMasterSelectionMode(masterSelectionMode: string): void;
setOperation(operation: string): void;
setRecords(dupeRecords: string[]): void;
}
interface NLObjEmailMerger {
/**
* Perform the merge and return an object containing email subject and body.
* @governance 20 units
*/
merge(): { subject: string, body: string };
/**
* Associate a custom record to the merger.
* @param {string} recordType type of the custom record
* @param {number} recordId ID of the record to be associated with the merger
*/
setCustomRecord(recordType: string, recordId: number): void;
/**
* Associate an entity to the merger.
* @param {string} entityType type of the entity (customer/contact/partner/vendor/employee)
* @param {number} entityId ID of the entity to be associated with the merger
*/
setEntity(entityType: string, entityId: number): void;
/**
* Associate a second entity (recipient) to the merger.
* @param {string} recipientType type of the entity (customer/contact/partner/vendor/employee)
* @param {number} recipientId ID of the entity to be associated with the merger
*/
setRecipient(recipientType: string, recipientId: number): void;
/**
* Associate a support case to the merger.
* @param {number} caseId ID of the support case to be associated with the merger
*/
setSupportCase(caseId: number): void;
/**
* Associate a transaction to the merger
* @param {number} transactionId ID of the transaction to be associated with the merger
*/
setTransaction(transactionId: number): void;
}
/**
* Return a new instance of nlobjError used system or user-defined error object.
*
* @classDescription Encapsulation of errors thrown during script execution.
*
* @constructor
*/
declare function nlobjError(): NLObjError;
interface NLObjError {
/**
* Return the error code for this system or user-defined error.
*/
getCode(): string;
/**
* Return the error description for this error.
*/
getDetails(): string;
/**
* Return the error db ID for this error (if it was an unhandled unexpected error).
*/
getId(): string;
/**
* Return the internalid of the record if this error was thrown in an aftersubmit script.
*/
getInternalID(): number;
/**
* Return a stacktrace containing the location of the error.
*/
getStackTrace(): string[];
/**
* Return the userevent script name where this error was thrown.
*/
getUserEvent(): string;
}
interface NLObjField {
/**
* Add a select option to this field (valid for select/multiselect fields). This method is only supported on scripted fields via the UI Object API.
*
* @param {string} value internal ID for this select option
* @param {string} text display value for this select option
* @param {boolean} selected if true then this select option will be selected by default
*/
addSelectOption(value: string, text: string, selected?: boolean): void;
/**
* Return field label.
*/
getLabel(): string;
/**
* Return field name.
*/
getName(): string;
/**
* This method can only be used in server contexts against a record object. Also note that a call to this method may return different results for the same field for different roles.
*
* @param {string} filter A search string to filter the select options that are returned.
* @param {string} filteroperator Supported operators are contains | is | startswith. If not specified, defaults to the contains operator.
*/
getSelectOptions(filter?: string, filteroperator?: string): NLObjSelectOption[];
/**
* Return field type.
*/
getType(): string;
/**
* Set the alias used to set the value for this field. Defaults to field name. This method is only supported on scripted fields via the UI Object API.
*
* @param {string} alias Column used to populate the field (mostly relevant when populating sublist fields).
*/
setAlias(alias: string): NLObjField;
/**
* Set the break type (startcol|startrow|none) for this field. startrow is only used for fields with a layout type of outside. This method is only supported on scripted fields via the UI Object API.
*
* @param {string} breaktype Break type used to add a break in flow layout for this field: startcol | startrow | none.
*/
setBreakType(breaktype: string): NLObjField;
/**
* Set the default value for this field. This method is only supported on scripted fields via the UI Object API.
*
* @param {string} value
*/
setDefaultValue(value: string): NLObjField;
/**
* Set the width and height for this field. This method is only supported on scripted fields via the UI Object API.
*
* @param {number} width
* @param {number} height
*/
setDisplaySize(width: number, height?: number): NLObjField;
/**
* Set the display type for this field. This method is only supported on scripted fields via the UI Object API
*
* @param {string} type display type: inline|normal|hidden|disabled|readonly|entry
*/
setDisplayType(type: string): NLObjField;
/**
* Set help text for this field. If inline is set on assistant pages, help is displayed inline below field. This method is only supported on scripted fields via the UI Object API.
*
* @param {string} help Field level help content (rich text) for field.
* @param {string} inline If true then in addition to the popup field help, the help will also be displayed inline below field (supported on assistant pages only).
*/
setHelpText(help: string, inline?: boolean): NLObjField;
/**
* Set the label for this field. This method is only supported on scripted fields via the UI Object API.
*
* @param {string} label
*/
setLabel(label: string): NLObjField;
/**
* Set the layout type and optionally the break type. This method is only supported on scripted fields via the UI Object API
*
* @param {string} type Layout type: outside|startrow|midrow|endrow|normal
* @param {string} breaktype Break type: startcol|startrow|none
*/
setLayoutType(type: string, breaktype?: string): NLObjField;
/**
* Set the text that gets displayed in lieu of the field value for URL fields.
*
* @param {string} text user-friendly display value in lieu of URL
*/
setLinkText(text: string): NLObjField;
/**
* Make this field mandatory. This method is only supported on scripted fields via the UI Object API
*
* @param {boolean} mandatory if true then field becomes mandatory
*/
setMandatory(mandatory: boolean): NLObjField;
/**
* Set the maxlength for this field (only valid for certain field types). This method is only supported on scripted fields via the UI Object API.
*
* @param {number} maxLength maximum length for this field
*/
setMaxLength(maxLength: number): NLObjField;
/**
* Set the amount of empty vertical space (rows) between this field and the previous field. This method is only supported on scripted fields via the UI Object API.
*
* @param {number} padding # of empty rows to display above field
*/
setPadding(padding: number): NLObjField;
}
interface NLObjFieldGroup {
/**
* Set collapsibility property for this field group.
*
* @param {boolean} collapsible if true then this field group is collapsible
* @param {boolean} defaultcollapsed if true and the field group is collapsible, collapse this field group by default
*/
setCollapsible(collapsible: boolean, defaultcollapsed?: boolean): NLObjFieldGroup;
/**
* Set the label for this field group.
* @param {string} label display label for field group
*/
setLabel(label: string): NLObjFieldGroup;
/**
* Set showBorder property for this field group.
*
* @param {boolean} showBorder If true then this field group shows border including label of group.
*/
setShowBorder(showBorder: boolean): NLObjFieldGroup;
/**
* Set singleColumn property for this field group.
*
* @param {boolean} singleColumn if true then this field group is displayed in single column
*/
setSingleColumn(singleColumn: boolean): NLObjFieldGroup;
}
interface NLObjFile {
/**
* Return the file description.
*/
getDescription(): string;
/**
* Return the internal ID of the folder that this file is in.
*/
getFolder(): number;
/**
* Return the id of the file (if stored in the FC).
*/
getId(): number;
/**
* Return the name of the file.
*/
getName(): string;
/**
* Return the size of the file in bytes.
*/
getSize(): number;
/**
* Return the type of the file.
*/
getType(): string;
/**
* Return the URL of the file (if stored in the FC).
*/
getURL(): string;
/**
* Return the value (base64 encoded for binary types) of the file.
*/
getValue(): string;
/**
* Return true if the file is inactive.
*/
isInactive(): boolean;
/**
* Return true if the file is "Available without Login".
*/
isOnline(): boolean;
/**
* Sets the file's description.
* @param {string} description the file description
*/
setDescription(description: string): void;
/**
* Sets the character encoding for the file.
* @param {string} encoding
*/
setEncoding(encoding: string): void;
/**
* Sets the internal ID of the folder that this file is in.
* @param {number} folder
*/
setFolder(folder: number): void;
/**
* Sets the file's inactive status.
* @param {boolean} inactive
*/
setIsInactive(inactive: boolean): void;
/**
* Sets the file's "Available without Login" status.
* @param {boolean} online
*/
setIsOnline(online: boolean): void;
/**
* Sets the name of a file.
* @param {string} name the name of the file.
*/
setName(name: string): void;
}
interface NLObjForm {
/**
* Add a button to this form.
*
* @param {string} name button name
* @param {string} label button label
* @param {string} script button script (function name)
*/
addButton(name: string, label: string, script: string): NLObjButton;
/**
* Adds a field that lets you store credentials in NetSuite to be used when invoking services provided by third parties.
*
* @param {string} id The internal ID of the credential field.
* @param {string} label The UI label for the credential field.
* @param {string} website The domain the credentials can be sent to.
* @param {string} scriptId The scriptId of the script that is allowed to use this credential field.
* @param {string} value If you choose, you can set an initial value for this field. This value is the handle to the credentials.
* @param {boolean} entityMatch Controls whether use of nlapiRequestUrlWithCredentials with this credential is restricted to the same entity that originally entered the credential.
* @param {string} tab The tab parameter can be used to specify either a tab or a field group (if you have added nlobjFieldGroup objects to your form).
*/
addCredentialField(id: string, label: string, website?: string, scriptId?: string, value?: string, entityMatch?: boolean, tab?: string): NLObjField;
/**
* Add a field (nlobjField) to this form and return it.
*
* @param {string} name field name
* @param {string} type field type
* @param {string} label field label
* @param {string|number} sourceOrRadio Script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields
* @param {string} tab Tab name that this field will live on. If empty then the field is added to the main section of the form (immediately below the title bar).
*/
addField(name: string, type: string, label: string, sourceOrRadio?: string|number, tab?: string): NLObjField;
/**
* Add a field group to the form.
* @param {string} name field group name
* @param {string} label field group label
* @param {string} tab
*/
addFieldGroup(name: string, label: string, tab?: string): NLObjFieldGroup;
/**
* Add a navigation cross-link to the page.
*
* @param {string} type page link type: crosslink|breadcrumb
* @param {string} title page link title
* @param {string} url URL for page link
*/
addPageLink(type: string, title: string, url: string): void;
/**
* Add a reset button to this form.
*
* @param {string} label Label for this button. defaults to "Reset".
*/
addResetButton(label?: string): NLObjButton;
/**
* Add a sublist (nlobjSubList) to this form and return it.
*
* @param {string} name sublist name
* @param {string} type sublist type: inlineeditor|editor|list|staticlist
* @param {string} label sublist label
* @param {string} tab parent tab that this sublist lives on. If empty, it is added to the main tab
*/
addSubList(name: string, type: string, label: string, tab?: string): NLObjSubList;
/**
* Add a submit button to this form.
*
* @param {string} label Label for this submit button. Defaults to "Save".
*/
addSubmitButton(label?: string): NLObjButton;
/**
* Add a subtab (nlobjTab) to this form and return it.
*
* @param {string} name subtab name
* @param {string} label subtab label
* @param {string} tab parent tab that this subtab lives on. If empty, it is added to the main tab.
*/
addSubTab(name: string, label: string, tab?: string): NLObjTab;
/**
* Add a tab (nlobjTab) to this form and return it.
*
* @param {string} name tab name
* @param {string} label tab label
*/
addTab(name: string, label: string): NLObjTab;
/**
* Get a button from this form by name.
* @param {string} name Button Id.
*/
getButton(name: string): NLObjButton;
/**
* Return a field (nlobjField) on this form.
*
* @param {string} name field name
* @param {string} radio If this is a radio field, specify which radio field to return based on radio value.
*/
getField(name: string, radio?: string): NLObjField;
/**
* Return a sublist (nlobjSubList) on this form.
*
* @param {string} name sublist name
*/
getSubList(name: string): NLObjSubList;
/**
* Return a subtab (nlobjTab) on this form.
*
* @param {string} name subtab name
*/
getSubTab(name: string): NLObjTab;
/**
* Return a tab (nlobjTab) on this form.
*
* @param {string} name Tab name.
*/
getTab(name: string): NLObjTab;
/**
* Get a list of all tabs.
*/
getTabs(): string[];
/**
* Insert a field (nlobjField) before another field (name).
*
* @param {NLObjField} field The field object to insert.
* @param {string} nextfld The name of the field before which to insert this field.
*/
insertField(field: NLObjField, nextfld: string): NLObjField;
/**
* Insert a sublist (nlobjSubList) before another subtab or sublist (name).
*
* @param {NLObjSubList} sublist The sublist object to insert.
* @param {string} nextsublist The name of the sublist before which to insert this sublist.
*/
insertSubList(sublist: NLObjSubList, nextsublist: string): NLObjSubList;
/**
* Insert a subtab (nlobjTab) before another subtab or sublist (name).
*
* @param {NLObjTab} subtab The subtab object to insert.
* @param {string} nextsubtab The name of the subtab before which to insert this subtab.
*/
insertSubTab(subtab: NLObjTab, nextsubtab: string): NLObjTab;
/**
* Insert a tab (nlobjTab) before another tab (name).
*
* @param {NLObjTab} tab the tab object to insert
* @param {string} nexttab the name of the tab before which to insert this tab
*/
insertTab(tab: NLObjTab, nexttab: string): NLObjTab;
/**
* Removes an nlobjButton object. This method can be used on custom buttons and certain built-in NetSuite buttons.
* @param {string} name
*/
removeButton(name: string): void;
/**
* Set the values for all the fields on this form.
*
* @param {Object} values Object containing field name/value pairs
*/
setFieldValues(values: Object): void;
/**
* Set the Client Script definition used for this page.
*
* @param {string|number} script Script ID or internal ID for global client script used to enable Client SuiteScript on page
*/
setScript(script: string|number): void;
/**
* Set the page title.
*
* @param {string} title
*/
setTitle(title: string): void;
}
interface NLObjFuture {
cancel(): boolean;