-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
7604 lines (6912 loc) · 255 KB
/
index.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
// Type definitions for SuiteScript
// Project: http://www.netsuite.com
// Definitions by: Adam Smith <https://github.com/burkybang>
/**
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=chapter_N3164298.html
*/
declare namespace nlobjRecord.prototype {
// nlobjRecord.prototype.getSubList.!ret
interface GetSubListRet {
prototype: {
addButton: /*no type*/{};
setLabel: /* nlobjSubList.prototype.setLabel */ any;
setHelpText: /* nlobjSubList.prototype.setHelpText */ any;
setDisplayType: /* nlobjSubList.prototype.setDisplayType */ any;
setLineItemValue: /* nlobjSubList.prototype.setLineItemValue */ any;
setLineItemMatrixValue: /* nlobjSubList.prototype.setLineItemMatrixValue */ any;
setLineItemValues: /* nlobjSubList.prototype.setLineItemValues */ any;
getLineItemCount: /* nlobjSubList.prototype.getLineItemCount */ string | number;
addField: /* nlobjSubList.prototype.addField */ any;
setUniqueField: /* nlobjSubList.prototype.setUniqueField */ any;
addRefreshButton: /* nlobjSubList.prototype.addRefreshButton */ any;
addMarkAllButtons: /* nlobjSubList.prototype.addMarkAllButtons */ any;
};
}
}
declare namespace nlobjRecord.prototype.GetSubListRet.prototype {
// nlobjRecord.prototype.getSubList.!ret.prototype.addButton.!ret
interface AddButtonRet {
prototype: {
setLabel: /* nlobjButton.prototype.setLabel */ any;
setDisabled: /* nlobjButton.prototype.setDisabled */ any;
};
}
}
declare namespace nlobjRecord.prototype {
// nlobjRecord.prototype.getField.!ret
interface GetFieldRet {
prototype: {
getName: /* nlobjField.prototype.getName */ any;
getLabel: /* nlobjField.prototype.getLabel */ any;
getType: /* nlobjField.prototype.getType */ any;
isHidden: /* nlobjField.prototype.isHidden */ any;
isMandatory: /* nlobjField.prototype.isMandatory */ any;
isDisabled: /* nlobjField.prototype.isDisabled */ any;
setLabel: /* nlobjField.prototype.setLabel */ any;
setAlias: /* nlobjField.prototype.setAlias */ any;
setDefaultValue: /* nlobjField.prototype.setDefaultValue */ any;
setDisabled: /* nlobjField.prototype.setDisabled */ any;
setMandatory: /* nlobjField.prototype.setMandatory */ any;
setMaxLength: /* nlobjField.prototype.setMaxLength */ any;
setDisplayType: /* nlobjField.prototype.setDisplayType */ any;
setBreakType: /* nlobjField.prototype.setBreakType */ any;
setLayoutType: /* nlobjField.prototype.setLayoutType */ any;
setLinkText: /* nlobjField.prototype.setLinkText */ any;
setDisplaySize: /* nlobjField.prototype.setDisplaySize */ any;
setPadding: /* nlobjField.prototype.setPadding */ any;
setHelpText: /* nlobjField.prototype.setHelpText */ any;
addSelectOption: /* nlobjField.prototype.addSelectOption */ any;
};
}
}
declare namespace nlobjPortlet.prototype {
// nlobjPortlet.prototype.addEditColumn.!0
interface AddEditColumn0 {
prototype: {
setLabel: /* nlobjColumn.prototype.setLabel */ any;
setURL: /* nlobjColumn.prototype.setURL */ any;
addParamToURL: /* nlobjColumn.prototype.addParamToURL */ any;
};
}
}
declare namespace nlobjForm.prototype {
// nlobjForm.prototype.addTab.!ret
interface AddTabRet {
prototype: {
setLabel: /* nlobjTab.prototype.setLabel */ any;
setHelpText: /* nlobjTab.prototype.setHelpText */ any;
};
}
}
declare namespace nlobjAssistant.prototype {
// nlobjAssistant.prototype.setCurrentStep.!0
interface SetCurrentStep0 {
prototype: {
setLabel: /* nlobjAssistantStep.prototype.setLabel */ any;
setHelpText: /* nlobjAssistantStep.prototype.setHelpText */ any;
getStepNumber: /* nlobjAssistantStep.prototype.getStepNumber */ any;
getFieldValue: /* nlobjAssistantStep.prototype.getFieldValue */ any;
getFieldValues: /* nlobjAssistantStep.prototype.getFieldValues */ string[];
getLineItemCount: /* nlobjAssistantStep.prototype.getLineItemCount */ string | number;
getLineItemValue: /* nlobjAssistantStep.prototype.getLineItemValue */ string;
getAllFields: /* nlobjAssistantStep.prototype.getAllFields */ string[];
getAllLineItems: /* nlobjAssistantStep.prototype.getAllLineItems */ any;
getAllLineItemFields: /* nlobjAssistantStep.prototype.getAllLineItemFields */ any;
};
}
}
declare namespace nlobjForm.prototype {
// nlobjForm.prototype.addFieldGroup.!ret
interface AddFieldGroupRet {
prototype: {
setLabel: /* nlobjFieldGroup.prototype.setLabel */ any;
setCollapsible: /* nlobjFieldGroup.prototype.setCollapsible */ any;
setSingleColumn: /* nlobjFieldGroup.prototype.setSingleColumn */ any;
setShowBorder: /* nlobjFieldGroup.prototype.setShowBorder */ any;
};
}
}
declare namespace nlobjForm.prototype {
// nlobjForm.prototype.addButton.!ret
interface AddButtonRet {
prototype: {
setLabel: /* nlobjButton.prototype.setLabel */ any;
setDisabled: /* nlobjButton.prototype.setDisabled */ any;
};
}
}
/**
* Return a new record using values from an existing record.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3028087
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param type - The record type name.
* @param id - The internal ID for the record.
* @param initializeValues - Contains an array of name/value pairs of defaults to be used during record initialization.
* @return Returns an nlobjRecord object of a copied record.
*
* @since 2007.0
*/
declare function nlapiCopyRecord(type: string, id: number | string, initializeValues?: Object): nlobjRecord;
/**
* Sets the line item field of a sublist to disabled or enabled based on the value (true or false).
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3043335
* @restriction supported in client scripts only
*
* @param type - Sublist internal ID
* @param fieldId - Name of the line item field to enable/disable
* @param value - If set to true the field is disabled. If set to false it is enabled.
*/
declare function nlapiDisableLineItemField(type: string, fieldId: string, value: boolean): void;
/**
* Sets the field to disabled or enabled based on the value (true or false).
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3039396
* @restriction supported in client scripts only
*
* @param fieldId - Name of the line item field to enable/disable
* @param value - If set to true the field is disabled. If set to false it is enabled.
*/
declare function nlapiDisableField(fieldId: string, value: boolean): void;
/**
* Loads an existing saved search. The saved search could have been created using the UI or created using nlapiCreateSearch(type, filters, columns) in conjunction with nlobjSearch.saveSearch(title, scriptId).
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3051062.html#bridgehead_N3051604
* @governance 5 units
*
* @param [type] - Record internal ID of the record type you are searching (for example, customer|lead|prospect|partner|vendor|contact). This parameter is case-insensitive.
* @param id - Internal ID or script ID of the saved search. The script ID of the saved search is required, regardless of whether you specify the search type. If you do not specify the search type, you must set type to null and then set the script/search ID.
*
* @since 2012.1
*/
declare function nlapiLoadSearch(type: string, id: string): nlobjSearch;
/**
* Creates a new search. The search can be modified and run as an on demand search, without saving it. Alternatively, calling nlobjSearch.saveSearch(title, scriptId) will save the search to the database, so it can be resused later in the UI or using nlapiLoadSearch(type, id).
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3051062.html#bridgehead_N3051237
*
* @param type - Record internal ID of the record type you are searching (for example, customer|lead|prospect|partner|vendor|contact). This parameter is case-insensitive.
* @param filters
* @param columns
*
* @since 2012.1
*/
declare function nlapiCreateSearch(type: string, filters: nlobjSearchFilter | nlobjSearchFilter[] | (string | number | (string | number | (string | number)[])[])[], columns: nlobjSearchColumn | nlobjSearchColumn[]): nlobjSearch;
/**
* Load an existing record from the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3030703
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param type - The record type name.
* @param id - The internal ID for the record.
* @param initializeValues - Contains an array of name/value pairs of defaults to be used during record initialization.
* @return Returns an nlobjRecord object of an existing NetSuite record.
*
* @exception {SSS_INVALID_RECORD_TYPE}
* @exception {SSS_TYPE_ARG_REQD}
* @exception {SSS_INVALID_INTERNAL_ID}
* @exception {SSS_ID_ARG_REQD}
*
* @since 2007.0
*/
declare function nlapiLoadRecord(type: string, id: number | string, initializeValues?: Object): nlobjRecord;
/**
* Instantiate a new nlobjRecord object containing all the default field data for that record type.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3028483
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param type - Record type ID.
* @param initializeValues - Contains an array of name/value pairs of defaults to be used during record initialization.
* @return Returns an nlobjRecord object of a new record from the system.
*
* @exception {SSS_INVALID_RECORD_TYPE}
* @exception {SSS_TYPE_ARG_REQD}
*
* @since 2007.0
*/
declare function nlapiCreateRecord(type: string, initializeValues?: Object): nlobjRecord;
/**
* Submit a record to the system for creation or update.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3031704
* @governance 20 units for transactions, 4 for custom records, 8 for all other records
*
* @param record - nlobjRecord object containing the data record.
* @param [doSourcing] - If not set, this argument defaults to false.
* @param [ignoreMandatoryFields] - Disables mandatory field validation for this submit operation.
* @return internal ID for committed record.
*
* @exception {SSS_INVALID_RECORD_OBJ}
* @exception {SSS_RECORD_OBJ_REQD}
* @exception {SSS_INVALID_SOURCE_ARG}
*
* @since 2007.0
*
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3031704
*/
declare function nlapiSubmitRecord(record: nlobjRecord, doSourcing?: boolean, ignoreMandatoryFields?: boolean): number;
/**
* Delete a record from the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3028788
* @governance 20 units for transactions, 4 for custom records, 8 for all other records
*
* @param type - The record type name.
* @param id - The internal ID for the record.
*
* @exception {SSS_INVALID_RECORD_TYPE}
* @exception {SSS_TYPE_ARG_REQD}
* @exception {SSS_INVALID_INTERNAL_ID}
* @exception {SSS_ID_ARG_REQD}
*
* @since 2007.0
*/
declare function nlapiDeleteRecord(type: string, id: number | string): void;
/**
* Perform a record search using an existing search or filters and columns.
* @governance 10 units
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3051062.html#bridgehead_N3052418
* @restriction returns the first 1000 rows in the search
*
* @param type - Record type ID.
* @param [id] - The internal ID or script ID for the saved search to use for search.
* @param [filters]
* @param [columns]
* @return Returns an array of nlobjSearchResult objects corresponding to the searched records.
*
* @exception {SSS_INVALID_RECORD_TYPE}
* @exception {SSS_TYPE_ARG_REQD}
* @exception {SSS_INVALID_SRCH_ID}
* @exception {SSS_INVALID_SRCH_FILTER}
* @exception {SSS_INVALID_SRCH_FILTER_JOIN}
* @exception {SSS_INVALID_SRCH_OPERATOR}
* @exception {SSS_INVALID_SRCH_COL_NAME}
* @exception {SSS_INVALID_SRCH_COL_JOIN}
*
* @since 2007.0
*/
declare function nlapiSearchRecord(type: string, id: number | string, filters: nlobjSearchFilter | nlobjSearchFilter[] | (string | number | (string | number | (string | number)[])[])[], columns: nlobjSearchColumn | nlobjSearchColumn[]): nlobjSearchResult[] | void;
/**
* Perform a global record search across the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3051062.html#bridgehead_N3052216
* @governance 10 units
* @restriction returns the first 1000 rows in the search
*
* @param keywords - Global search keywords string or expression.
* @return Returns an Array of nlobjSearchResult objects containing the following four columns: name, type (as shown in the UI), info1, and info2.
*
* @since 2008.1
*/
declare function nlapiSearchGlobal(keywords: string): nlobjSearchResult[];
/**
* Perform a duplicate record search using Duplicate Detection criteria.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3051062.html#bridgehead_N3052026
* @governance 10 units
* @restriction returns the first 1000 rows in the search
*
* @param type - The recordType you are checking duplicates for (for example, customer|lead|prospect|partner|vendor|contact).
* @param [fields] - Array of field names used to detect duplicate (for example, companyname|email|name|phone|address1|city|state|zipcode).
* @param [id] - Internal ID of existing record. Depending on the use case, id may or may not be a required argument.
* @return Returns an Array of nlobjSearchResult objects corresponding to the duplicate records.
*
* @since 2008.1
*/
declare function nlapiSearchDuplicate(type: string, fields: string[], id?: number): nlobjSearchResult[];
/**
* Create a new record using values from an existing record of a different type.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3032124
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param type - The record type name.
* @param id - The internal ID for the record.
* @param transformType - The recordType you are transforming the existing record into.
* @param [transformValues] - An object containing transform default option/value pairs used to pre-configure transformed record
*
* @exception {SSS_INVALID_URL_CATEGORY}
* @exception {SSS_CATEGORY_ARG_REQD}
* @exception {SSS_INVALID_TASK_ID}
* @exception {SSS_TASK_ID_REQD}
* @exception {SSS_INVALID_INTERNAL_ID}
* @exception {SSS_INVALID_EDITMODE_ARG}
*
* @since 2007.0
*/
declare function nlapiTransformRecord(type: string, id: number | string, transformType: string, transformValues?: Object): nlobjRecord;
/**
* void a transaction based on type and id.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_3784149312
* @governance 10 units for transactions
*
* @param type - The transaction type name.
* @param id - The internal ID for the record.
* @return If accounting preference is reversing journal, then it is new journal id, otherwise, it is the input record id
*
* @since 2014.1
*/
declare function nlapiVoidTransaction(type: string, id: number | string): string;
/**
* Fetch the value of one or more fields on a record. This API uses search to look up the fields and is much
* faster than loading the record in order to get the field.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3040351
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param recordType - The record type name.
* @param recordId - The internal ID for the record.
* @param fieldId - Field or fields to look up.
* @param [text] - If set then the display value is returned instead for select fields.
* @return Single value.
*
* @since 2008.1
*/
declare function nlapiLookupField(recordType: string, recordId: number | string, fieldId: string, text?: boolean): string;
/**
* Fetch the value of one or more fields on a record. This API uses search to look up the fields and is much
* faster than loading the record in order to get the field.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3040351
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
*
* @param recordType - The record type name.
* @param recordId - The internal ID for the record.
* @param fieldIds - Field or fields to look up.
* @param [text] - If set then the display value is returned instead for select fields.
* @return Object of field name/value pairs.
*
* @since 2008.1
*/
declare function nlapiLookupField<FieldId extends string>(recordType: string, recordId: number | string, fieldIds: FieldId[], text?: boolean): { [key in FieldId]: string };
/**
* Submit the values of a field or set of fields for an existing record.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3042189
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
* @restriction only supported for records and fields where DLE (Direct List Editing) is supported
*
* @param recordType - The record type name.
* @param recordId - The internal ID for the record.
* @param fieldId - Field being updated.
* @param value - Field value used for updating.
* @param [doSourcing = false] - If not set, this argument defaults to false and field sourcing does not occur.
*
* @since 2008.1
*/
declare function nlapiSubmitField(recordType: string, recordId: number | string, fieldId: string, value: string, doSourcing?: boolean): void;
/**
* Submit the values of a field or set of fields for an existing record.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3042189
* @governance 10 units for transactions, 2 for custom records, 4 for all other records
* @restriction only supported for records and fields where DLE (Direct List Editing) is supported
*
* @param recordType - The record type name.
* @param recordId - The internal ID for the record.
* @param fieldIds - Fields being updated.
* @param values - Field values used for updating.
* @param [doSourcing = false] - If not set, this argument defaults to false and field sourcing does not occur.
*
* @since 2008.1
*/
declare function nlapiSubmitField(recordType: string, recordId: number | string, fieldIds: string[], values: string[], doSourcing?: boolean): void;
/**
* Attach a single record to another with optional properties.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3027757
* @governance 10 units
*
* @param recordType1 - The record type name being attached
* @param recordId1 - The internal ID for the record being attached
* @param recordType2 - The record type name being attached to
* @param recordId2 - The internal ID for the record being attached to
* @param [attributes] - Object containing name/value pairs used to configure attach operation
*
* @since 2008.2
*/
declare function nlapiAttachRecord(recordType1: string, recordId1: number | string, recordType2: string, recordId2: number | string, attributes?: Object): void;
/**
* Detach a single record from another with optional properties.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3030101
* @governance 10 units
*
* @param recordType1 - The record type name being attached
* @param recordId1 - The internal ID for the record being attached
* @param recordType2 - The record type name being attached to
* @param recordId2 - The internal ID for the record being attached to
* @param [attributes] - Object containing name/value pairs used to configure detach operation
*
* @since 2008.2
*/
declare function nlapiDetachRecord(recordType1: string, recordId1: number | string, recordType2: string, recordId2: number | string, attributes?: Object): void;
/**
* Resolve a URL to a resource or object in the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3059898
*
* @param type - Type specifier for URL
* @param recordType - Type of the record
* @param [recordId] - Internal ID of the record
* @param [pageMode = 'VIEW'] - View or edit mode
*
* @since 2007.0
*/
declare function nlapiResolveURL(
type: 'RECORD' | 'record',
recordType: string,
recordId?: number | string,
pageMode?: 'VIEW' | 'EDIT' | 'view' | 'edit',
): string;
/**
* Resolve a URL to a resource or object in the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3059898
*
* @param type - Type specifier for URL
* @param scriptId - Internal ID or scriptid of the script
* @param deploymentId - Internal ID or scriptid of the deployment
* @param [pageMode = 'INTERNAL'] - Internal or externak URL
*
* @since 2007.0
*/
declare function nlapiResolveURL(
type: 'SUITELET' | 'RESTLET' | 'suitelet' | 'restlet',
scriptId: number | string,
deploymentId: number | string,
pageMode?: 'INTERNAL' | 'EXTERNAL' | 'internal' | 'external' | boolean,
): string;
/**
* Resolve a URL to a resource or object in the system.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3059898
*
* @param type - Type specifier for URL
* @param taskId - Subtype specifier for URL
*
* @since 2007.0
*/
declare function nlapiResolveURL(type: 'TASKLINK' | 'tasklink', taskId: string): string;
/**
* Redirect the user to a page. Only valid in the UI on Suitelets and User Events. In Client scripts this will initialize the redirect URL used upon submit.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3060274
*
* @param type - Type specifier for URL
* @param recordType - Type of the record
* @param [recordId] - Internal ID of the record
* @param [editMode = false] - View or edit mode
* @param [parameters] - Object used to specify additional URL parameters as name/value pairs
*
* @since 2007.0
*/
declare function nlapiSetRedirectURL(type: 'RECORD' | 'record', recordType: string, recordId?: number | string, editMode?: boolean, parameters?: Record<string, string | number>): void;
/**
* Redirect the user to a page. Only valid in the UI on Suitelets and User Events. In Client scripts this will initialize the redirect URL used upon submit.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3060274
*
* @param type - Type specifier for URL
* @param scriptId - Internal ID or scriptid of the script
* @param deploymentId - Internal ID or scriptid of the deployment
* @param [editMode] - View or edit mode
* @param [parameters] - Object used to specify additional URL parameters as name/value pairs
*
* @since 2007.0
*/
declare function nlapiSetRedirectURL(type: 'SUITELET' | 'suitelet', scriptId: number | string, deploymentId: number | string, editMode?: boolean, parameters?: Record<string, string | number>): void;
/**
* Redirect the user to a page. Only valid in the UI on Suitelets and User Events. In Client scripts this will initialize the redirect URL used upon submit.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3060274
*
* @param type - Type specifier for URL
* @param taskId - ID of the task
*
* @since 2007.0
*/
declare function nlapiSetRedirectURL(type: 'TASKLINK' | 'tasklink', taskId: string): void;
/**
* Redirect the user to a page. Only valid in the UI on Suitelets and User Events. In Client scripts this will initialize the redirect URL used upon submit.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3060274
*
* @param type - Type specifier for URL
* @param url - External URL
*
* @since 2007.0
*/
declare function nlapiSetRedirectURL(type: 'EXTERNAL' | 'external', url: string): void;
/**
* Request a URL to an external or internal resource.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3059035.html#bridgehead_N3059142
* @restriction NetSuite maintains a white list of CAs that are allowed for https requests. Please see the online documentation for the complete list.
* @governance 10 units
*
* @param url - A fully qualified URL to an HTTP(s) resource
* @param [postdata] - String, document, or Object containing POST payload
* @param [headers] - Object containing request headers.
* @param [callback] - Available on the Client to support asynchronous requests. function is passed an nlobjResponse with the results.
* @param [method] - Supported http methods are HEAD, DELETE and PUT
*
* @exception {SSS_UNKNOWN_HOST}
* @exception {SSS_INVALID_HOST_CERT}
* @exception {SSS_REQUEST_TIME_EXCEEDED}
*
* @since 2007.0
*/
declare function nlapiRequestURL(url: string, postdata?: string | Object, headers?: Object, callback?: Function, method?: 'HEAD' | 'DELETE' | 'PUT' | 'head' | 'delete' | 'put'): nlobjResponse;
/**
* Return context information about the current user/script.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3055647
*
* @since 2007.0
*/
declare function nlapiGetContext(): nlobjContext;
/**
* Return the internal ID for the currently logged in user. Returns -4 when called from online forms or "Available without Login" Suitelets.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3056076
*
* @since 2005.0
*/
declare function nlapiGetUser(): number;
/**
* 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.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3055936
*
* @since 2005.0
*/
declare function nlapiGetRole(): number;
/**
* Return the internal ID for the current user's department.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3055799
*
* @since 2005.0
*/
declare function nlapiGetDepartment(): number;
/**
* Return the internal ID for the current user's location.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3055865
*
* @since 2005.0
*/
declare function nlapiGetLocation(): number;
/**
* Return the internal ID for the current user's subsidiary.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3055475.html#bridgehead_N3056010
*
* @since 2008.1
*/
declare function nlapiGetSubsidiary(): number;
/**
* Return the recordtype corresponding to the current page or userevent script.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3030601
*
* @since 2007.0
*/
declare function nlapiGetRecordType(): string;
/**
* Return the internal ID corresponding to the current page or userevent script.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3027360.html#bridgehead_N3030530
*
* @since 2007.0
*/
declare function nlapiGetRecordId(): string;
/**
* Send out an email and associate it with records in the system.
* Supported base types are entity for entities, transaction for transactions, activity for activities and cases, record|recordtype for custom records
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3068135.html#bridgehead_N3068387
* @governance 10 units
* @restriction all outbound emails subject to email Anti-SPAM policies
*
* @param author - Internal ID for employee user on behalf of whom this email is sent
* @param recipient - Email address, email addresses separated by commas, array of email addresses, or internal ID of user that this email is being sent to
* @param subject - Email subject
* @param body - Email body
* @param cc - Copy email address(es)
* @param bcc - Blind copy email address(es)
* @param records - Object of base types -> internal IDs used to associate email to records. i.e. {entity: 100, record: 23, recordtype: customrecord_surveys}
* @param attachments - Array of nlobjFile objects (files) to include as attachments
* @param notifySenderOnBounce - Controls whether or not the sender will receive email notification of bounced emails (defaults to false)
* @param internalOnly - Controls or not the resultingMmessage record will be visible to non-employees on the Communication tab of attached records (defaults to false)
* @param replyTo - Email reply-to address
*
* @since 2007.0
*/
declare function nlapiSendEmail(author: number, recipient: string | string[] | number, subject: string, body: string, cc?: string | string[], bcc?: string | string[], records?: Object, attachments?: nlobjFile | nlobjFile[], notifySenderOnBounce?: boolean, internalOnly?: boolean, replyTo?: string): void;
/**
* Sends a single on-demand campaign email to a specified recipient and returns a campaign response ID to track the email.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3068135.html#bridgehead_N3068234
* @governance 10 units
* @restriction works in conjunction with the Lead Nurturing (campaigndrip) sublist only
*
* @param campaignEventId - Internal ID of the campaign event
* @param recipientId - Internal ID of the recipient - the recipient must have an email
*
* @since 2010.1
*/
declare function nlapiSendCampaignEmail(campaignEventId: number, recipientId: number): number;
/**
* Send out a fax and associate it with records in the system. This requires fax preferences to be configured.
* Supported base types are entity for entities, transaction for transactions, activity for activities and cases, record|recordtype for custom records
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3068135.html#bridgehead_N3070553
* @governance 10 units
*
* @param from - Internal ID for employee user on behalf of whom this fax is sent
* @param to - Fax address or internal ID of user that this fax is being sent to
* @param subject - Fax subject
* @param body - Fax body
* @param records - Object of base types -> internal IDs used to associate fax to records. i.e. {entity: 100, record: 23, recordtype: customrecord_surveys}
* @param attachments - Array of nlobjFile objects (files) to include as attachments
*
* @since 2008.2
*/
declare function nlapiSendFax(from: number, to: string | number, subject: string, body: string, records: Object, attachments: nlobjFile | nlobjFile[]): void;
/**
* Return field definition for a field.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3039511
*
* @param name - The name of the field
*
* @since 2009.1
*/
declare function nlapiGetField(name: string): nlobjField;
/**
* Return field definition for a matrix field.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3047553
*
* @param type - Matrix sublist name
* @param name - Matrix field name
* @param column - Matrix field column index (1-based)
*
* @since 2009.2
*/
declare function nlapiGetMatrixField(type: string, name: string, column: number): nlobjField;
/**
* Return field definition for a sublist field.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3044648
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param [linenum] - Line number for sublist field (1-based) and only valid for sublists of type staticlist and list
*
* @since 2009.1
*/
declare function nlapiGetLineItemField(type: string, fieldId: string, linenum?: number): nlobjField;
/**
* Return an nlobjField containing sublist field metadata.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3044836
*
* @param type - Matrix sublist name
* @param fieldId - Matrix field name
* @param linenum - Line number (1-based)
* @param column - Matrix column index (1-based)
*
* @since 2009.2
*/
declare function nlapiGetLineItemMatrixField(type: string, fieldId: string, linenum: number, column: number): nlobjField;
/**
* Return the value of a field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3039936
* @restriction supported in client and user event scripts only.
*
* @param fieldId - The field name
*
* @since 2005.0
*/
declare function nlapiGetFieldValue(fieldId: string): string;
/**
* Set the value of a field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3041626
* @restriction supported in client and user event scripts only.
* @restriction synchronous arg is only supported in client SuiteScript
*
* @param fieldId - The field name
* @param value - Value used to set field
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2005.0
*/
declare function nlapiSetFieldValue(fieldId: string, value: string, firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Return the display value of a select field's current selection on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3039686
* @restriction supported in client and user event scripts only.
*
* @param fieldId - The field name
*
* @since 2005.0
*/
declare function nlapiGetFieldText(fieldId: string): string;
/**
* Set the value of a field on the current record on a page using it's label.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3041236
* @restriction synchronous arg is only supported in client SuiteScript
*
* @param fieldId - The field name
* @param txt - Display name used to lookup field value
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2009.1
*
*/
declare function nlapiSetFieldText(fieldId: string, txt: string, firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Return the values of a multiselect field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3040092
* @restriction supported in client and user event scripts only.
*
* @param fieldId - The field name
*
* @since 2005.0
*/
declare function nlapiGetFieldValues(fieldId: string): string[];
/**
* Set the values of a multiselect field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3041926
* @restriction supported in client and user event scripts only.
* @restriction synchronous arg is only supported in client SuiteScript
*
* @param fieldId - Field name
* @param values - Array of strings containing values for field
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2005.0
*/
declare function nlapiSetFieldValues(fieldId: string, values: string[], firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Return the values (via display text) of a multiselect field on the current record.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3039830
* @restriction supported in client and user event scripts only.
*
* @param fieldId - Field name
*
* @since 2009.1
*/
declare function nlapiGetFieldTexts(fieldId: string): void;
/**
* Set the values (via display text) of a multiselect field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3039111.html#bridgehead_N3041422
* @restriction supported in client and user event scripts only.
* @restriction synchronous arg is only supported in client SuiteScript
*
* @param fieldId - Field name
* @param texts - Array of strings containing display values for field
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2009.1
*/
declare function nlapiSetFieldTexts(fieldId: string, texts: string[], firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Get the value of a matrix header field
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3047782
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param column - Matrix column index (1-based)
*
* @since 2009.2
*/
declare function nlapiGetMatrixValue(type: string, fieldId: string, column: number): string;
/**
* Set the value of a matrix header field
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3050444
* @restriction synchronous arg is only supported in client SuiteScript
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param column - Matrix column index (1-based)
* @param value - Field value for matrix field
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2009.2
*/
declare function nlapiSetMatrixValue(type: string, fieldId: string, column: number, value: string, firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Get the current value of a sublist field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3043926
* @restriction supported in client and user event scripts only.
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param column - Matrix column index (1-based)
*
* @since 2009.2
*/
declare function nlapiGetCurrentLineItemMatrixValue(type: string, fieldId: string, column: number): string;
/**
* Set the current value of a sublist field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3049008
* @restriction supported in client and user event scripts only.
* @restriction synchronous arg is only supported in Client SuiteScript
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param column - Matrix column index (1-based)
* @param value - Matrix field value
* @param [firefieldchanged] - If false then the field change event is suppressed (defaults to true)
* @param [synchronous] - If true then sourcing and field change execution happens synchronously (defaults to false).
*
* @since 2009.2
*/
declare function nlapiSetCurrentLineItemMatrixValue(type: string, fieldId: string, column: number, value: string, firefieldchanged?: boolean, synchronous?: boolean): void;
/**
* Return the value of a sublist matrix field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3045070
* @restriction supported in client and user event scripts only.
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param linenum - Line number (1-based)
* @param column - Column index (1-based)
* @param value
*
* @since 2009.2
*/
declare function nlapiGetLineItemMatrixValue(type: string, fieldId: string, linenum: number, column: number): void;
/**
* Return the value of a sublist field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3045409
* @restriction supported in client and user event scripts only.
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param linenum - Line number (1-based)
*
* @since 2005.0
*/
declare function nlapiGetLineItemValue(type: string, fieldId: string, linenum: number): string;
/**
* Return the values of a multiselect sublist field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N3042487.html#bridgehead_N3045558
* @restriction supported in client and user event scripts only.
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param linenum - Line number (1-based)
*
* @since 2005.0
*/
declare function nlapiGetLineItemValues(type: string, fieldId: string, linenum: number): string[];
/**
* Return the value of a sublist field on the current record on a page.
* @see https://system.netsuite.com/app/help/helpcenter.nl?fid=section_3745066611.html#bridgehead_3745076438
* @restriction supported in client and user event scripts only.
*
* @param type - Sublist name
* @param fieldId - Sublist field name
* @param linenum - Line number (1-based)
* @param timezone - Value
*
* @since 2013.2
*/
declare function nlapiGetLineItemDateTimeValue(type: string, fieldId: string, linenum: number, timezone: string): string;