@hitc/netsuite-types 2025.1.2 → 2025.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/N/action.d.ts +3 -3
- package/N/certificateControl.d.ts +3 -3
- package/N/compress.d.ts +6 -6
- package/N/config.d.ts +1 -1
- package/N/crypto/certificate.d.ts +4 -4
- package/N/crypto.d.ts +2 -2
- package/N/currentRecord.d.ts +2 -2
- package/N/dataset.d.ts +2 -2
- package/N/datasetLink.d.ts +2 -2
- package/N/email.d.ts +4 -4
- package/N/format.d.ts +1 -1
- package/N/http.d.ts +12 -12
- package/N/https/clientCertificate.d.ts +6 -6
- package/N/https.d.ts +8 -8
- package/N/keyControl.d.ts +3 -3
- package/N/log.d.ts +4 -4
- package/N/pgp.d.ts +1 -1
- package/N/plugins/fiParserPlugin.d.ts +1 -1
- package/N/plugins/glPlugin.d.ts +7 -7
- package/N/portlet.d.ts +2 -2
- package/N/record.d.ts +9 -9
- package/N/recordContext.d.ts +2 -2
- package/N/redirect.d.ts +5 -5
- package/N/render.d.ts +8 -8
- package/N/runtime.d.ts +7 -7
- package/N/search.d.ts +7 -7
- package/N/sftp.d.ts +1 -1
- package/N/task.d.ts +2 -2
- package/N/transaction.d.ts +1 -1
- package/N/types.d.ts +13 -13
- package/N/ui/serverWidget.d.ts +3 -3
- package/N/url.d.ts +2 -2
- package/N/workbook.d.ts +3 -3
- package/N/workflow.d.ts +3 -3
- package/N/xml.d.ts +6 -6
- package/N.d.ts +4 -4
- package/README.md +4 -4
- package/example-ClientScript.ts +5 -5
- package/example-GL-Plugin.ts +1 -1
- package/example-RESTlet.ts +3 -3
- package/example-UserEventScript.ts +6 -6
- package/package.json +1 -1
- package/spec/assets/Restlet1Sample.ts +2 -2
- package/spec/assets/Suitelet1Sample.ts +4 -4
- package/spec/assets/UserEvent1Sample.ts +5 -5
package/N/action.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ interface ActionExecuteFunction {
|
|
|
48
48
|
* Returns an executable record action for the specified record type.
|
|
49
49
|
* If the recordId parameter is specified, the action object is returned only if the specified action can be executed on the specified record instance.
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export const get: ActionGetFunction;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Performs a search for available record actions.
|
|
@@ -61,14 +61,14 @@ export var get: ActionGetFunction;
|
|
|
61
61
|
*
|
|
62
62
|
* If the recordId is specified in this call, the actions that are found are considered qualified. You do not have to provide the recordId to execute a qualified action.
|
|
63
63
|
*/
|
|
64
|
-
export
|
|
64
|
+
export const find: ActionFindFunction;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Executes the record action and returns the action results in a plain JavaScript object.
|
|
68
68
|
* If the action fails, it is listed in the results object’s notifications property.
|
|
69
69
|
* If the action executes successfully, the notifications property is usually empty.
|
|
70
70
|
*/
|
|
71
|
-
export
|
|
71
|
+
export const execute: ActionExecuteFunction;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Executes an asynchronous bulk record action and returns its task ID for status queries with action.getBulkStatus(options).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {File} from './file';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The N/certificateControl module enables scripting access to the Digital Certificates list found in the UI at Setup > Company > Certificates.
|
|
@@ -12,7 +12,7 @@ export interface Certificate {
|
|
|
12
12
|
/** Describes the certificate record. */
|
|
13
13
|
description: string;
|
|
14
14
|
/** The File Object Members object of the certificate uploaded to the certificate record. */
|
|
15
|
-
file:
|
|
15
|
+
file: File;
|
|
16
16
|
/** The name of the certificate record. */
|
|
17
17
|
name: string;
|
|
18
18
|
/**
|
|
@@ -68,7 +68,7 @@ export function loadCertificate(options: { scriptId: string }): Certificate;
|
|
|
68
68
|
|
|
69
69
|
interface CreateCertificateOptions {
|
|
70
70
|
/** A File Object Members object. The file must already be uploaded to the File Cabinet. */
|
|
71
|
-
file:
|
|
71
|
+
file: File;
|
|
72
72
|
/** If applicable, the password associated with your digital certificate. */
|
|
73
73
|
password?: string;
|
|
74
74
|
/** The desired script ID of the certificate record. The script ID is automatically prefixed with ‘custcertificate_’ */
|
package/N/compress.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* You can create an archive by using compress.createArchiver() and add multiple files to the archive.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import type {File} from './file';
|
|
10
10
|
|
|
11
11
|
interface ArchiverAddOptions {
|
|
12
12
|
/** The file to be archived. */
|
|
13
|
-
file:
|
|
13
|
+
file: File;
|
|
14
14
|
/** The target directory in the archive. If this parameter is not specified, the file is placed in the root directory of the archive. */
|
|
15
15
|
directory?: string;
|
|
16
16
|
}
|
|
@@ -25,21 +25,21 @@ interface ArchiverArchiveOptions {
|
|
|
25
25
|
/** The functionality for creating an archive file. Use compress.createArchiver() to create this object. */
|
|
26
26
|
export interface Archiver {
|
|
27
27
|
add(options: ArchiverAddOptions): void;
|
|
28
|
-
archive(options: ArchiverArchiveOptions):
|
|
28
|
+
archive(options: ArchiverArchiveOptions): File;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
interface GZipOptions {
|
|
32
32
|
/** The file to be compressed. */
|
|
33
|
-
file:
|
|
33
|
+
file: File;
|
|
34
34
|
/** The compression level. 0 is no compression. 9 is the best compression level. */
|
|
35
35
|
level?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/** Compresses a file by using gzip and returns it as a temporary file object. 0 is no compression. */
|
|
39
|
-
export function gzip(options: GZipOptions):
|
|
39
|
+
export function gzip(options: GZipOptions): File;
|
|
40
40
|
|
|
41
41
|
/** Decompresses a file that was compressed using gzip and returns it as a temporary file object. */
|
|
42
|
-
export function gunzip(options: { file:
|
|
42
|
+
export function gunzip(options: { file: File }): File;
|
|
43
43
|
|
|
44
44
|
/** Creates a compress.Archiver object that can be used for creating file archives, such as ZIP or TAR files. */
|
|
45
45
|
export declare function createArchiver(): Archiver;
|
package/N/config.d.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* In addition to signing XML documents, you can create signer and verifier objects and verify signed documents with this module.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import type {File} from '../file';
|
|
7
|
+
import type {NSXMLDocument} from '../xml';
|
|
8
8
|
|
|
9
9
|
export interface SignedXml {
|
|
10
|
-
asFile():
|
|
10
|
+
asFile(): File;
|
|
11
11
|
asString(): string;
|
|
12
|
-
asXml():
|
|
12
|
+
asXml(): NSXMLDocument;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export interface Signer {
|
package/N/crypto.d.ts
CHANGED
package/N/currentRecord.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {ClientCurrentRecord} from './record';
|
|
1
|
+
import type {ClientCurrentRecord} from './record';
|
|
2
2
|
|
|
3
3
|
interface GetCurrentRecordFunction {
|
|
4
4
|
(): ClientCurrentRecord;
|
|
5
5
|
promise(): Promise<ClientCurrentRecord>;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const get: GetCurrentRecordFunction;
|
package/N/dataset.d.ts
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* For more information on using workbooks, see N/workbook Module.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import {PagedData, RelativeDate, ResultSet} from "./query";
|
|
14
|
-
import {Expression} from "./workbook";
|
|
13
|
+
import type {PagedData, RelativeDate, ResultSet} from "./query";
|
|
14
|
+
import type {Expression} from "./workbook";
|
|
15
15
|
|
|
16
16
|
/** Encapsulates the record fields in the dataset. Columns are equivalent to the fields you use when you build a dataset in SuiteAnalytics. */
|
|
17
17
|
interface Column {
|
package/N/datasetLink.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
*
|
|
12
12
|
* For more information about linking datasets in SuiteAnalytics Workbook, see Dataset Linking in SuiteAnalytics Workbook.
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
14
|
+
import type {Dataset} from "./dataset";
|
|
15
|
+
import type {Expression} from "./workbook";
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
interface CreateDatasetLinkOptions {
|
package/N/email.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {File} from './file';
|
|
1
|
+
import type {File} from './file';
|
|
2
2
|
|
|
3
3
|
interface SendOptions {
|
|
4
4
|
/**
|
|
@@ -106,13 +106,13 @@ interface EmailSendCampaignFunction {
|
|
|
106
106
|
/**
|
|
107
107
|
* Method used to send transactional email asynchronously and receive bounceback notifications if the email is not successfully delivered.
|
|
108
108
|
*/
|
|
109
|
-
export
|
|
109
|
+
export const send: EmailSendFunction;
|
|
110
110
|
/**
|
|
111
111
|
* This method is used to send bulk email when a bounceback notification is not required.
|
|
112
112
|
*/
|
|
113
|
-
export
|
|
113
|
+
export const sendBulk: EmailSendFunction;
|
|
114
114
|
/**
|
|
115
115
|
* Method used to send a single “on-demand” campaign email to a specified recipient and return a campaign response ID to track the email.
|
|
116
116
|
* Email (campaignemail) sublists are not supported. The campaign must use a Lead Nurturing (campaigndrip) sublist.
|
|
117
117
|
*/
|
|
118
|
-
export
|
|
118
|
+
export const sendCampaignEvent: EmailSendCampaignFunction;
|
package/N/format.d.ts
CHANGED
package/N/http.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {File} from './file';
|
|
2
|
-
import {Assistant, Form, List} from './ui/serverWidget';
|
|
3
|
-
import {SecureString} from './https';
|
|
1
|
+
import type {File} from './file';
|
|
2
|
+
import type {Assistant, Form, List} from './ui/serverWidget';
|
|
3
|
+
import type {SecureString} from './https';
|
|
4
4
|
|
|
5
5
|
interface AddHeaderOptions {
|
|
6
6
|
/** The name of the header. */
|
|
@@ -90,7 +90,7 @@ export interface GetOptions {
|
|
|
90
90
|
/** The HTTP URL being requested. */
|
|
91
91
|
url: string | SecureString;
|
|
92
92
|
/** -optional- The HTTP headers. */
|
|
93
|
-
headers?:
|
|
93
|
+
headers?: object;
|
|
94
94
|
/**
|
|
95
95
|
* Pass an array of GUIDs here to be decoded by the server. Reference GUIDs must be in curly braces where used.
|
|
96
96
|
* For example, if you have a GUID for a username:password for basic auth, your header would be: { Authorization: `Basic {${guid}}` }
|
|
@@ -162,7 +162,7 @@ export interface ClientResponse {
|
|
|
162
162
|
/**
|
|
163
163
|
* The response header or headers.
|
|
164
164
|
*/
|
|
165
|
-
headers:
|
|
165
|
+
headers: object;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
interface GetSublistValueOptions {
|
|
@@ -201,7 +201,7 @@ export interface ServerRequest {
|
|
|
201
201
|
/**
|
|
202
202
|
* The server request headers.
|
|
203
203
|
*/
|
|
204
|
-
headers:
|
|
204
|
+
headers: object;
|
|
205
205
|
/**
|
|
206
206
|
* The server request http method.
|
|
207
207
|
* Allow usage as string here as N/http is a heavy import just
|
|
@@ -279,34 +279,34 @@ export interface ServerResponse {
|
|
|
279
279
|
/**
|
|
280
280
|
* The server response headers. This property is read-only.
|
|
281
281
|
*/
|
|
282
|
-
headers:
|
|
282
|
+
headers: object;
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
286
|
* Sends an HTTP GET request and returns the response.
|
|
287
287
|
*/
|
|
288
|
-
export
|
|
288
|
+
export const get: HttpGetFunction;
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* Sends an HTTP DELETE request and returns the response.
|
|
292
292
|
*/
|
|
293
|
-
declare
|
|
293
|
+
declare const deleteFunc: HttpDeleteFunction;
|
|
294
294
|
export {deleteFunc as delete};
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* Sends an HTTP request and returns the response.
|
|
298
298
|
*/
|
|
299
|
-
export
|
|
299
|
+
export const request: HttpRequestFunction;
|
|
300
300
|
|
|
301
301
|
/**
|
|
302
302
|
* Sends an HTTP POST request and returns the response.
|
|
303
303
|
*/
|
|
304
|
-
export
|
|
304
|
+
export const post: HttpPostFunction;
|
|
305
305
|
|
|
306
306
|
/**
|
|
307
307
|
* Sends an HTTP PUT request and returns the response.
|
|
308
308
|
*/
|
|
309
|
-
export
|
|
309
|
+
export const put: HttpPutFunction;
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
312
|
* Holds the string values for supported cache durations.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/** Load the clientCertificate module to send SSL requests with a digital certificate. */
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import type {ClientResponse} from '../https';
|
|
4
4
|
|
|
5
|
-
export function post(options: { url: string, certId: string, body: string, headers?: { [key: string]: any } }):
|
|
6
|
-
export function get(options: GetDeleteOptions):
|
|
7
|
-
export function put(options: { url: string, certId: string, body: string, headers?: { [key: string]: any } }):
|
|
5
|
+
export function post(options: { url: string, certId: string, body: string, headers?: { [key: string]: any } }): ClientResponse;
|
|
6
|
+
export function get(options: GetDeleteOptions): ClientResponse;
|
|
7
|
+
export function put(options: { url: string, certId: string, body: string, headers?: { [key: string]: any } }): ClientResponse;
|
|
8
8
|
declare const deleteFunc: DeleteMethod; // Workaround for the fact that "delete" is a JS keyword.
|
|
9
9
|
export {deleteFunc as delete};
|
|
10
|
-
export function request(options: RequestOptions):
|
|
10
|
+
export function request(options: RequestOptions): ClientResponse;
|
|
11
11
|
|
|
12
12
|
interface DeleteMethod {
|
|
13
|
-
(options: GetDeleteOptions):
|
|
13
|
+
(options: GetDeleteOptions): ClientResponse;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface GetDeleteOptions {
|
package/N/https.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {Encoding} from './encode';
|
|
2
|
-
import {ClientResponse
|
|
3
|
-
import {HashAlg, SecretKey} from './crypto';
|
|
1
|
+
import type {Encoding} from './encode';
|
|
2
|
+
import type {ClientResponse} from './http'
|
|
3
|
+
import type {HashAlg, SecretKey} from './crypto';
|
|
4
4
|
|
|
5
5
|
interface CreateSecretKeyOptions {
|
|
6
6
|
/** Specifies the encoding for the SecureKey. */
|
|
@@ -160,12 +160,12 @@ export {get, delete as delete, request, post, put, CacheDuration, Method, Client
|
|
|
160
160
|
|
|
161
161
|
// METHODS \\
|
|
162
162
|
/** Creates a key for the contents of a credential field. */
|
|
163
|
-
export
|
|
163
|
+
export const createSecretKey: HttpsCreateSecretKeyFunction;
|
|
164
164
|
|
|
165
165
|
/**
|
|
166
166
|
* Creates an https.SecureString object.
|
|
167
167
|
*/
|
|
168
|
-
export
|
|
168
|
+
export const createSecureString: HttpsCreateSecureStringFunction;
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
171
|
* Sends an HTTPS request to a RESTlet and returns the response. Authentication headers are automatically added.
|
|
@@ -173,7 +173,7 @@ export var createSecureString: HttpsCreateSecureStringFunction;
|
|
|
173
173
|
*
|
|
174
174
|
* @governance 10 units
|
|
175
175
|
*/
|
|
176
|
-
export
|
|
176
|
+
export const requestRestlet: RequestRestletFunction;
|
|
177
177
|
|
|
178
178
|
/**
|
|
179
179
|
* Sends an HTTPS request to a Suitelet and returns the response.
|
|
@@ -184,13 +184,13 @@ export var requestRestlet: RequestRestletFunction;
|
|
|
184
184
|
*
|
|
185
185
|
* @governance 10 units
|
|
186
186
|
*/
|
|
187
|
-
export
|
|
187
|
+
export const requestSuitelet: RequestSuiteletFunction;
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* Sends an HTTPS request to a SuiteTalk REST endpoint and returns the response. Authentication headers are automatically added.
|
|
191
191
|
*
|
|
192
192
|
* @governance 10 units
|
|
193
193
|
*/
|
|
194
|
-
export
|
|
194
|
+
export const requestSuiteTalkRest: RequestSuiteTalkRestFunction;
|
|
195
195
|
|
|
196
196
|
export {Encoding} from './encode';
|
package/N/keyControl.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* By using the SSH keys, you can manage files and directories by using the SSH file transfer (SFTP) protocol.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import type {File} from './file';
|
|
7
7
|
|
|
8
8
|
export function createKey(options: CreateKeyOptions): Key;
|
|
9
9
|
export function findKeys(options: FindKeysOptions): { [key: string]: any }; // TODO: Confirm return type. Documentation says its "meta-data"
|
|
@@ -18,7 +18,7 @@ export enum Operator {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
interface Key {
|
|
21
|
-
file:
|
|
21
|
+
file: File;
|
|
22
22
|
/** The password of the key. GUID or secret token for working with passwords is accepted. */
|
|
23
23
|
password: string;
|
|
24
24
|
/** The script ID of the key. Using Key.save() and keyControl.findKeys(options) returns the script ID. */
|
|
@@ -31,7 +31,7 @@ interface Key {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
interface CreateKeyOptions {
|
|
34
|
-
file?:
|
|
34
|
+
file?: File;
|
|
35
35
|
/** The password of the key. GUID or secret token for working with passwords is accepted. */
|
|
36
36
|
password?: string;
|
|
37
37
|
/** The script ID of the key. Using Key.save() and keyControl.findKeys(options) returns the script ID. */
|
package/N/log.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ interface LogFunction {
|
|
|
14
14
|
(options: LogOptions): void;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
17
|
+
export const debug: LogFunction;
|
|
18
|
+
export const audit: LogFunction;
|
|
19
|
+
export const error: LogFunction;
|
|
20
|
+
export const emergency: LogFunction;
|
package/N/pgp.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* PGP stands for Pretty Good Privacy and is most commonly used for encrypting emails.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {Signer} from "./crypto/certificate";
|
|
6
|
+
import type {Signer} from "./crypto/certificate";
|
|
7
7
|
|
|
8
8
|
/** Stores general configuration options that can be used for message decryption. Use the pgp.createConfig(options) method to create a new configuration object. */
|
|
9
9
|
interface Config {
|
package/N/plugins/glPlugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type {Type, FieldValue} from '../record';
|
|
2
2
|
|
|
3
3
|
interface FindSublistLineWithValueOptions {
|
|
4
4
|
/** The internal ID of the sublist. */
|
|
@@ -6,7 +6,7 @@ interface FindSublistLineWithValueOptions {
|
|
|
6
6
|
/** The internal ID of a standard or custom sublist field. */
|
|
7
7
|
fieldId: string;
|
|
8
8
|
/** The value to search for. */
|
|
9
|
-
value:
|
|
9
|
+
value: FieldValue;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
interface GetFieldOptions {
|
|
@@ -41,18 +41,18 @@ export interface ReadOnlySubrecord {
|
|
|
41
41
|
/** Returns the value of a sublist field in a text representation. */
|
|
42
42
|
getSublistText(options: SublistLineOptions): string;
|
|
43
43
|
/** Returns the value of a sublist field. */
|
|
44
|
-
getSublistValue(options: SublistLineOptions):
|
|
44
|
+
getSublistValue(options: SublistLineOptions): FieldValue;
|
|
45
45
|
/** Returns the text representation of a field value. */
|
|
46
46
|
getText(options: GetFieldOptions): string;
|
|
47
47
|
/** Returns the value of a field. */
|
|
48
|
-
getValue(options: GetFieldOptions):
|
|
48
|
+
getValue(options: GetFieldOptions): FieldValue;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface ReadOnlyTransactionRecord {
|
|
52
52
|
/** Use this property to get the internal ID of a record when editing an existing transaction. */
|
|
53
53
|
readonly id: number | null;
|
|
54
54
|
/** Returns the record type internal ID. */
|
|
55
|
-
readonly recordType:
|
|
55
|
+
readonly recordType: Type | string;
|
|
56
56
|
/** Returns the body field names (internal IDs) of all the fields in the transaction record, including the machine header field and matrix header fields. */
|
|
57
57
|
readonly fields: string[];
|
|
58
58
|
/** Returns all the names (internal IDs) of all the sublists in the transaction record. */
|
|
@@ -68,13 +68,13 @@ export interface ReadOnlyTransactionRecord {
|
|
|
68
68
|
/** Returns the value of a sublist field in a text representation. */
|
|
69
69
|
getSublistText(options: SublistLineOptions): string;
|
|
70
70
|
/** Returns the value of a sublist field. */
|
|
71
|
-
getSublistValue(options: SublistLineOptions):
|
|
71
|
+
getSublistValue(options: SublistLineOptions): FieldValue;
|
|
72
72
|
/** Returns the subrecord for the associated field. */
|
|
73
73
|
getSubrecord(options: GetFieldOptions): ReadOnlySubrecord;
|
|
74
74
|
/** Returns the text representation of a field value. */
|
|
75
75
|
getText(options: GetFieldOptions): string;
|
|
76
76
|
/** Returns the value of a field. */
|
|
77
|
-
getValue(options: GetFieldOptions):
|
|
77
|
+
getValue(options: GetFieldOptions): FieldValue;
|
|
78
78
|
/** Returns the value indicating whether the associated sublist field contains a subrecord */
|
|
79
79
|
hasSublistSubrecord(options: SublistLineOptions): boolean;
|
|
80
80
|
/** Returns the value indicating whether the field contains a subrecord. */
|
package/N/portlet.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {BaseForm, Button, Field, FieldType, LayoutJustification, ListColumn} from './ui/serverWidget';
|
|
2
|
-
import {Result} from './search';
|
|
1
|
+
import type {BaseForm, Button, Field, FieldType, LayoutJustification, ListColumn} from './ui/serverWidget';
|
|
2
|
+
import type {Result} from './search';
|
|
3
3
|
|
|
4
4
|
interface SetSubmitButtonOptions {
|
|
5
5
|
url: string;
|
package/N/record.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {AddSelectOptionOptions} from './ui/serverWidget';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Submits a new record or saves edits to an existing record.
|
|
@@ -808,16 +808,16 @@ interface RecordTransformOptions {
|
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
/** Attaches a record to another record. */
|
|
811
|
-
export
|
|
811
|
+
export const attach: RecordAttachFunction;
|
|
812
812
|
/** Creates a new record by copying an existing record in NetSuite. */
|
|
813
|
-
export
|
|
813
|
+
export const copy: RecordCopyFunction;
|
|
814
814
|
/** Creates a new record. */
|
|
815
|
-
export
|
|
815
|
+
export const create: RecordCreateFunction;
|
|
816
816
|
/** Deletes a record. */
|
|
817
|
-
declare
|
|
817
|
+
declare const deleteFunc: RecordDeleteFunction;
|
|
818
818
|
export { deleteFunc as delete };
|
|
819
819
|
/** Detaches a record from another record. */
|
|
820
|
-
export
|
|
820
|
+
export const detach: RecordDetachFunction;
|
|
821
821
|
/**
|
|
822
822
|
* Loads an existing nlobjRecord from the database based on provided type, id
|
|
823
823
|
*
|
|
@@ -825,7 +825,7 @@ export var detach: RecordDetachFunction;
|
|
|
825
825
|
*
|
|
826
826
|
* @throws {SuiteScriptError} SSS_MISSING_REQD_ARGUMENT if options.type or options.id is missing
|
|
827
827
|
*/
|
|
828
|
-
export
|
|
828
|
+
export const load: RecordLoadFunction;
|
|
829
829
|
/**
|
|
830
830
|
* commit record field updates to the system.
|
|
831
831
|
*
|
|
@@ -846,9 +846,9 @@ export var load: RecordLoadFunction;
|
|
|
846
846
|
*
|
|
847
847
|
* @throws {SuiteScriptError} SSS_MISSING_REQD_ARGUMENT if type or id is missing
|
|
848
848
|
*/
|
|
849
|
-
export
|
|
849
|
+
export const submitFields: SubmitFieldsFunction;
|
|
850
850
|
/** Transforms a record from one type into another, using data from an existing record. */
|
|
851
|
-
export
|
|
851
|
+
export const transform: RecordTransformFunction;
|
|
852
852
|
|
|
853
853
|
/** N/record.Type enum */
|
|
854
854
|
export enum Type { // As of 4 June 2024
|
package/N/recordContext.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* behaves differently based on the context.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import type {ClientCurrentRecord, Record} from './record';
|
|
9
9
|
|
|
10
10
|
interface GetContextOptions {
|
|
11
11
|
/** The record type. Required if the record is not loaded in your script. */
|
|
@@ -13,7 +13,7 @@ interface GetContextOptions {
|
|
|
13
13
|
/** The record ID. Required if the record is not loaded in your script. */
|
|
14
14
|
recordId?: string;
|
|
15
15
|
/** The record object. Required if the record is loaded in your script. */
|
|
16
|
-
record?:
|
|
16
|
+
record?: Record | ClientCurrentRecord;
|
|
17
17
|
/** The available context types. Optional. */
|
|
18
18
|
contextTypes?: ContextType[];
|
|
19
19
|
}
|
package/N/redirect.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {Search} from './search';
|
|
2
|
-
import
|
|
1
|
+
import type {Search} from './search';
|
|
2
|
+
import type {Type} from './record';
|
|
3
3
|
|
|
4
4
|
interface RedirectOptions {
|
|
5
5
|
/** The URL of a Suitelet that is available externally. */
|
|
@@ -12,7 +12,7 @@ interface ToRecordOptions {
|
|
|
12
12
|
/** The internal id of the target record. */
|
|
13
13
|
id: string | number;
|
|
14
14
|
/** Type of record. */
|
|
15
|
-
type: string |
|
|
15
|
+
type: string | Type;
|
|
16
16
|
/** Determines whether to return a URL for the record in edit mode or view mode. If set to true, returns the URL to an existing record in edit mode. */
|
|
17
17
|
isEditMode?: boolean;
|
|
18
18
|
/** Contains additional URL parameters as key/value pairs. */
|
|
@@ -23,9 +23,9 @@ interface ToRecordTransformOptions {
|
|
|
23
23
|
/** The internal ID of the source record. */
|
|
24
24
|
fromId: string | number;
|
|
25
25
|
/** Type of the source record. */
|
|
26
|
-
fromType: string |
|
|
26
|
+
fromType: string | Type;
|
|
27
27
|
/** Type of the target record. */
|
|
28
|
-
toType: string |
|
|
28
|
+
toType: string | Type;
|
|
29
29
|
/** Contains additional parameters as key/value pairs. */
|
|
30
30
|
parameters?: any;
|
|
31
31
|
}
|
package/N/render.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {File} from './file';
|
|
2
|
-
import {Record} from './record';
|
|
3
|
-
import {ServerResponse} from './http';
|
|
4
|
-
import {Result} from './search';
|
|
5
|
-
import {NSXMLDocument} from './xml';
|
|
6
|
-
import
|
|
1
|
+
import type {File} from './file';
|
|
2
|
+
import type {Record} from './record';
|
|
3
|
+
import type {ServerResponse} from './http';
|
|
4
|
+
import type {Result} from './search';
|
|
5
|
+
import type {NSXMLDocument} from './xml';
|
|
6
|
+
import type {Query} from './query';
|
|
7
7
|
|
|
8
8
|
interface AddCustomDataSourceOptions {
|
|
9
9
|
/** Data source alias. */
|
|
@@ -138,7 +138,7 @@ interface TemplateRenderer {
|
|
|
138
138
|
addCustomDataSource(options: AddCustomDataSourceOptions): void;
|
|
139
139
|
/**
|
|
140
140
|
* Uses Query as the renderer’s data source.
|
|
141
|
-
* You can specify the SuiteAnalytics workbook query either in the
|
|
141
|
+
* You can specify the SuiteAnalytics workbook query either in the Query object, or provide a workbook ID to use the query from an existing SuiteAnalytics workbook.
|
|
142
142
|
* One of options.query or options.id is required in the script.
|
|
143
143
|
*/
|
|
144
144
|
addQuery(options: AddQueryOptions): void;
|
|
@@ -168,7 +168,7 @@ interface AddQueryOptions {
|
|
|
168
168
|
/** Template name. */
|
|
169
169
|
templateName: string;
|
|
170
170
|
/** Workbook query definition. Required if options.id is not specified. */
|
|
171
|
-
query?:
|
|
171
|
+
query?: Query;
|
|
172
172
|
/** Workbook query ID. Required if options.query is not specified. */
|
|
173
173
|
id?: string;
|
|
174
174
|
}
|
package/N/runtime.d.ts
CHANGED
|
@@ -74,23 +74,23 @@ interface FeatureOptions {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
/** The NetSuite account ID for the currently logged-in user. */
|
|
77
|
-
export
|
|
77
|
+
export const accountId: string;
|
|
78
78
|
/** The country for the current company. Returns the two-letter abbreviation. For example, US */
|
|
79
|
-
export
|
|
79
|
+
export const country: string;
|
|
80
80
|
/** The current environment in which the script is executing. This property returns one of the values from the runtime.EnvType enumeration. */
|
|
81
|
-
export
|
|
81
|
+
export const envType: EnvType;
|
|
82
82
|
/** Returns a runtime.ContextType enumeration that represents what triggered the current script. */
|
|
83
|
-
export
|
|
83
|
+
export const executionContext: ContextType;
|
|
84
84
|
/** The number of processors available to the currently logged in account.
|
|
85
85
|
SuiteCloud Processors is the current system used to execute (process) scheduled scripts and map/reduce scripts. This property is helpful if you are a SuiteApp developer and your script needs to know the total number of processors available to a deployment.
|
|
86
86
|
For scheduled script deployments that continue to use queues, use runtime.queueCount. With the introduction of SuiteCloud Processors, map/reduce script deployments and new scheduled script deployments no longer use queues, but pre-existing scheduled script deployments continue to use queues until the queues are removed (see SuiteCloud Processors – Supported Task Types).
|
|
87
87
|
Be aware that the number of processors available may not be the same as the number of queues available. For more information, see SuiteCloud Plus Settings.
|
|
88
88
|
*/
|
|
89
|
-
export
|
|
89
|
+
export const processorCount: number;
|
|
90
90
|
/** Returns the number of scheduled script queues in a given account. */
|
|
91
|
-
export
|
|
91
|
+
export const queueCount: number;
|
|
92
92
|
/** Returns the version of NetSuite that the method is called in. For example, the runtime.version property in an account running NetSuite 2015.2 is 2015.2. */
|
|
93
|
-
export
|
|
93
|
+
export const version: string;
|
|
94
94
|
/** Returns a runtime.Script that represents the currently executing script. */
|
|
95
95
|
export function getCurrentScript(): Script;
|
|
96
96
|
/** Returns a runtime.Session that represents the user session for the currently executing script. */
|
package/N/search.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FieldValue} from './record';
|
|
1
|
+
import type {FieldValue} from './record';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Encapsulates a search filter used in a search.
|
|
@@ -677,11 +677,11 @@ export enum Type { // As of 15 June 2020
|
|
|
677
677
|
* column with a formula using name: 'formulatext'.
|
|
678
678
|
*
|
|
679
679
|
*/
|
|
680
|
-
export
|
|
681
|
-
export
|
|
682
|
-
declare
|
|
680
|
+
export const create: SearchCreateFunction;
|
|
681
|
+
export const load: SearchLoadFunction;
|
|
682
|
+
declare const deleteFunc: SearchDeleteFunction;
|
|
683
683
|
export { deleteFunc as delete };
|
|
684
|
-
export
|
|
684
|
+
export const duplicates: SearchDuplicatesFunction;
|
|
685
685
|
|
|
686
686
|
/**
|
|
687
687
|
* Performs a global search against a single keyword or multiple keywords.
|
|
@@ -692,7 +692,7 @@ export var duplicates: SearchDuplicatesFunction;
|
|
|
692
692
|
* @returns search.Result[] as an array of result objects containing these columns: name, type, info1, and info2
|
|
693
693
|
* Results are limited to 1000 records. If there are no search results, this method returns null.
|
|
694
694
|
*/
|
|
695
|
-
export
|
|
695
|
+
export const global: SearchGlobalFunction;
|
|
696
696
|
|
|
697
697
|
/**
|
|
698
698
|
* Performs a search for one or more body fields on a record. You can use joined-field lookups with this method, with
|
|
@@ -718,7 +718,7 @@ export var global: SearchGlobalFunction;
|
|
|
718
718
|
* @returns Returns select fields as an object with value and text properties. Returns multiselect fields as an
|
|
719
719
|
array of object with value:text pairs.
|
|
720
720
|
*/
|
|
721
|
-
export
|
|
721
|
+
export const lookupFields: SearchLookupFieldsFunction;
|
|
722
722
|
|
|
723
723
|
export function createColumn(options: CreateSearchColumnOptions): Column;
|
|
724
724
|
/** Creates a new search filter as a search.Filter object.
|
package/N/sftp.d.ts
CHANGED
package/N/task.d.ts
CHANGED
package/N/transaction.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface TransactionVoidFunction {
|
|
|
9
9
|
promise(options: VoidOptions): Promise<number>;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
declare
|
|
12
|
+
declare const voidFunc: TransactionVoidFunction;
|
|
13
13
|
export {voidFunc as void};
|
|
14
14
|
|
|
15
15
|
export enum Type { // As of 15 July 2020
|
package/N/types.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import * as N_http from './http';
|
|
2
|
-
import * as N_portlet from './portlet';
|
|
3
|
-
import * as N_record from './record';
|
|
4
|
-
import * as N_search from './search';
|
|
5
|
-
import * as N_ui_serverWidget from './ui/serverWidget';
|
|
6
|
-
import * as N_FiConnectivity from "./plugins/fiConnectivityPlugin";
|
|
7
|
-
import * as N_FiParser from "./plugins/fiParserPlugin";
|
|
8
|
-
import * as N_GlPlugin from "./plugins/glPlugin";
|
|
9
|
-
import * as N_dataset from "./dataset";
|
|
10
|
-
import * as N_workbook from "./workbook";
|
|
1
|
+
import type * as N_http from './http';
|
|
2
|
+
import type * as N_portlet from './portlet';
|
|
3
|
+
import type * as N_record from './record';
|
|
4
|
+
import type * as N_search from './search';
|
|
5
|
+
import type * as N_ui_serverWidget from './ui/serverWidget';
|
|
6
|
+
import type * as N_FiConnectivity from "./plugins/fiConnectivityPlugin";
|
|
7
|
+
import type * as N_FiParser from "./plugins/fiParserPlugin";
|
|
8
|
+
import type * as N_GlPlugin from "./plugins/glPlugin";
|
|
9
|
+
import type * as N_dataset from "./dataset";
|
|
10
|
+
import type * as N_workbook from "./workbook";
|
|
11
11
|
|
|
12
12
|
/*Don't export these into the Namespace as we don't
|
|
13
13
|
want to accidentally use a comparison like this:
|
|
14
|
-
export
|
|
14
|
+
export const beforeSubmit: EntryPoints.UserEvent.beforeSubmit = (context) => {
|
|
15
15
|
//THIS IS WRONG
|
|
16
|
-
if(
|
|
16
|
+
if(context.Type == EntryPoints.UserEvent.Type.EDIT) {
|
|
17
17
|
...
|
|
18
18
|
}
|
|
19
19
|
};
|
|
@@ -217,7 +217,7 @@ export namespace EntryPoints {
|
|
|
217
217
|
InvocationType: ScheduledInvocationTypes;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
type execute = (scriptContext: executeContext) => void
|
|
220
|
+
type execute = (scriptContext: executeContext) => void | Promise<void>;
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
namespace MapReduce {
|
package/N/ui/serverWidget.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {ServerResponse} from '../http';
|
|
2
|
-
import {AddColumnOptions, AddEditColumnOptions, AddRowOptions, AddRowsOptions} from '../portlet';
|
|
3
|
-
import {Message, MessageCreateOptions} from './message';
|
|
1
|
+
import type {ServerResponse} from '../http';
|
|
2
|
+
import type {AddColumnOptions, AddEditColumnOptions, AddRowOptions, AddRowsOptions} from '../portlet';
|
|
3
|
+
import type {Message, MessageCreateOptions} from './message';
|
|
4
4
|
|
|
5
5
|
export interface AddButtonOptions {
|
|
6
6
|
/** The internal ID of the button. If you are adding the button to an existing page, the internal ID must be in lowercase, contain no spaces, and include the prefix custpage. */
|
package/N/url.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {Type} from "./record";
|
|
2
2
|
|
|
3
3
|
interface formatOptions {
|
|
4
4
|
domain: string;
|
|
@@ -13,7 +13,7 @@ interface resolveHostOptions {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
interface resolveRecordOptions {
|
|
16
|
-
recordType: string |
|
|
16
|
+
recordType: string | Type; // Documentation says it just accepts string, but Type values are strings.
|
|
17
17
|
recordId?: string | number; // Omitting this property produces a URL to a NEW record
|
|
18
18
|
isEditMode?: boolean;
|
|
19
19
|
params?: any;
|
package/N/workbook.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/** Load the N/workbook module when you want to create a new workbook, load an existing workbook, or list all existing workbooks. */
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import type {Dataset} from "./dataset";
|
|
4
|
+
import type {PagedData, ResultSet, SortLocale} from "./query";
|
|
5
|
+
import type {DatasetLink} from "./datasetLink";
|
|
6
6
|
|
|
7
7
|
interface Aspect {
|
|
8
8
|
measure: Measure;
|
package/N/workflow.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {Type} from "./record";
|
|
2
2
|
|
|
3
3
|
interface InitiateOptions {
|
|
4
|
-
recordType: string |
|
|
4
|
+
recordType: string | Type;
|
|
5
5
|
recordId: string | number;
|
|
6
6
|
workflowId: string | number;
|
|
7
7
|
defaultValues?: any;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
interface TriggerOptions {
|
|
11
|
-
recordType: string |
|
|
11
|
+
recordType: string | Type;
|
|
12
12
|
recordId: string | number;
|
|
13
13
|
/**
|
|
14
14
|
* Internal ID (number) or script ID (string) for the workflow definition. This is the ID field on the Workflow Definition Page.
|
package/N/xml.d.ts
CHANGED
|
@@ -253,12 +253,12 @@ interface SelectOptions {
|
|
|
253
253
|
xpath: string;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
export
|
|
257
|
-
export
|
|
258
|
-
export
|
|
259
|
-
export
|
|
260
|
-
export
|
|
261
|
-
export
|
|
256
|
+
export const Parser: ParserObject;
|
|
257
|
+
export const XPath: XPathObject;
|
|
258
|
+
export const Node: NSNode;
|
|
259
|
+
export const Document: NSXMLDocument;
|
|
260
|
+
export const Element: NSElement;
|
|
261
|
+
export const Attr: NSAttr;
|
|
262
262
|
export function escape(options: EscapeOptions): string;
|
|
263
263
|
export function validate(options: ValidateOptions): void;
|
|
264
264
|
export enum NodeType {
|
package/N.d.ts
CHANGED
|
@@ -40,10 +40,10 @@ import * as N_util from './N/util';
|
|
|
40
40
|
import * as N_workbook from './N/workbook';
|
|
41
41
|
import * as N_workflow from './N/workflow';
|
|
42
42
|
import * as N_xml from './N/xml';
|
|
43
|
-
import * as N_commerce_recordView from './N/commerce/recordView';
|
|
44
|
-
import * as N_ui_dialog from './N/ui/dialog';
|
|
45
|
-
import * as N_ui_message from './N/ui/message';
|
|
46
|
-
import * as N_ui_serverWidget from './N/ui/serverWidget';
|
|
43
|
+
import type * as N_commerce_recordView from './N/commerce/recordView';
|
|
44
|
+
import type * as N_ui_dialog from './N/ui/dialog';
|
|
45
|
+
import type * as N_ui_message from './N/ui/message';
|
|
46
|
+
import type * as N_ui_serverWidget from './N/ui/serverWidget';
|
|
47
47
|
// import * as N_crypto_certificate from './N/crypto/certificate';
|
|
48
48
|
// import * as N_https_clientCertificate from './N/https/clientCertificate';
|
|
49
49
|
|
package/README.md
CHANGED
|
@@ -52,13 +52,13 @@ At the top of every script you will want to have the following lines added:
|
|
|
52
52
|
* @NScriptType ClientScript
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
|
-
import {EntryPoints} from 'N/types';
|
|
55
|
+
import type {EntryPoints} from 'N/types';
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
`N/types` and `EntryPoints` isn't actually in the NetSuite API, but it is something that is included with this library to give you type definitons for your entry point functions. For example:
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
|
-
import {EntryPoints} from 'N/types';
|
|
61
|
+
import type {EntryPoints} from 'N/types';
|
|
62
62
|
export let pageInit: EntryPoints.Client.pageInit = (context: EntryPoints.Client.pageInitContext) => {
|
|
63
63
|
//Your IDE will now autocomplete from the context argument. For instance use this to access context.mode and context.currentRecord in this pageInit example
|
|
64
64
|
}
|
|
@@ -78,7 +78,7 @@ Full example for a User Event Script might look something like this:
|
|
|
78
78
|
* @NScriptType UserEventScript
|
|
79
79
|
*/
|
|
80
80
|
|
|
81
|
-
import {EntryPoints} from 'N/types';
|
|
81
|
+
import type {EntryPoints} from 'N/types';
|
|
82
82
|
import * as log from 'N/log';
|
|
83
83
|
|
|
84
84
|
export let beforeSubmit: EntryPoints.UserEvent.beforeSubmit = (context: EntryPoints.UserEvent.beforeSubmitContext) => {
|
|
@@ -95,7 +95,7 @@ export let beforeSubmit: EntryPoints.UserEvent.beforeSubmit = (context: EntryPoi
|
|
|
95
95
|
* @NScriptType Suitelet
|
|
96
96
|
*/
|
|
97
97
|
|
|
98
|
-
import {EntryPoints} from 'N/types';
|
|
98
|
+
import type {EntryPoints} from 'N/types';
|
|
99
99
|
import * as record from 'N/record';
|
|
100
100
|
|
|
101
101
|
export let onRequest: EntryPoints.Suitelet.onRequest = (context: EntryPoints.Suitelet.onRequestContext) => {
|
package/example-ClientScript.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* @NScriptType ClientScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {EntryPoints} from 'N/types'
|
|
7
|
-
import search
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
|
+
import * as search from 'N/search';
|
|
8
8
|
|
|
9
|
-
export function pageInit(
|
|
10
|
-
if (
|
|
9
|
+
export function pageInit(context: EntryPoints.Client.pageInitContext) {
|
|
10
|
+
if (context.mode != 'edit') return;
|
|
11
11
|
|
|
12
|
-
const customerId =
|
|
12
|
+
const customerId = context.currentRecord.getValue('entity'); // Assume this script is running on a transaction
|
|
13
13
|
search.lookupFields.promise({ type: 'customer', id: customerId, columns: ['companyname', 'datecreated', 'entitystatus'] }).then((values) => {
|
|
14
14
|
const name = values.companyname as string;
|
|
15
15
|
const date = values.datecreated as string;
|
package/example-GL-Plugin.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
/* This example is taken from https://suiteanswers.custhelp.com/app/answers/detail/a_id/1016997 */
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import type {EntryPoints} from "N/types";
|
|
9
9
|
import * as log from "N/log";
|
|
10
10
|
|
|
11
11
|
export const customizeGlImpact: EntryPoints.Plugins.GlPlugin.customizeGlImpact =
|
package/example-RESTlet.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @NScriptType UserEventScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
7
|
import * as log from 'N/log'
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const del: EntryPoints.RESTlet.delete_ = requestParams => {
|
|
10
10
|
let type = requestParams.type;
|
|
11
11
|
let id = requestParams.id;
|
|
12
12
|
|
|
@@ -16,6 +16,6 @@ var del: EntryPoints.RESTlet.delete_ = requestParams => {
|
|
|
16
16
|
}
|
|
17
17
|
export { del as delete };
|
|
18
18
|
|
|
19
|
-
export
|
|
19
|
+
export const post: EntryPoints.RESTlet.post = requestBody => {
|
|
20
20
|
return { success: true };
|
|
21
21
|
}
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* @NScriptType UserEventScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {EntryPoints} from 'N/types'
|
|
7
|
-
import log
|
|
8
|
-
import query
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
|
+
import * as log from 'N/log';
|
|
8
|
+
import * as query from 'N/query';
|
|
9
9
|
|
|
10
10
|
// Let's assume this example is deployed to sales orders
|
|
11
|
-
export function beforeSubmit(
|
|
12
|
-
if (
|
|
13
|
-
const customerId =
|
|
11
|
+
export function beforeSubmit(context: EntryPoints.UserEvent.beforeSubmitContext) {
|
|
12
|
+
if (context.type == context.UserEventType.CREATE) {
|
|
13
|
+
const customerId = context.newRecord.getValue('entity') as string;
|
|
14
14
|
log.debug('beforeSubmit', `Submitting new transaction for entity: ${customerId}`); // When creating a transaction from an entity, log the entity internal id
|
|
15
15
|
|
|
16
16
|
// SuiteQL example
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"posttest": "npm run cleanup"
|
|
9
9
|
},
|
|
10
10
|
"homepage": "https://github.com/headintheclouddev/typings-suitescript-2.0",
|
|
11
|
-
"version": "2025.1.
|
|
11
|
+
"version": "2025.1.4",
|
|
12
12
|
"author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @NScriptType UserEventScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {EntryPoints} from 'N/types'
|
|
7
|
-
import log
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
|
+
import * as log from 'N/log';
|
|
8
8
|
|
|
9
9
|
const del: EntryPoints.RESTlet.delete_ = requestParams => {
|
|
10
10
|
const type = requestParams.type;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* @NScriptType Suitelet
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {EntryPoints} from 'N/types';
|
|
7
|
-
import record
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
|
+
import * as record from 'N/record';
|
|
8
8
|
|
|
9
|
-
export const onRequest: EntryPoints.Suitelet.onRequest = (
|
|
9
|
+
export const onRequest: EntryPoints.Suitelet.onRequest = (context) => {
|
|
10
10
|
const folder = record.load({ type: 'folder', id: 36464 });
|
|
11
11
|
const allFields = folder.getFields().join(', ');
|
|
12
|
-
|
|
12
|
+
context.response.write(`<br>All fields: ${allFields}`);
|
|
13
13
|
};
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* @NScriptType UserEventScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import {EntryPoints} from 'N/types'
|
|
7
|
-
import log
|
|
6
|
+
import type {EntryPoints} from 'N/types';
|
|
7
|
+
import * as log from 'N/log';
|
|
8
8
|
|
|
9
|
-
export function beforeSubmit(
|
|
10
|
-
if (~[
|
|
11
|
-
const companyName =
|
|
9
|
+
export function beforeSubmit(context: EntryPoints.UserEvent.beforeSubmitContext) {
|
|
10
|
+
if (~[context.UserEventType.CREATE, context.UserEventType.EDIT].indexOf(context.type)) { // If type is create or edit, log the company name (applies to customer records).
|
|
11
|
+
const companyName = context.newRecord.getValue({ fieldId: 'companyname' });
|
|
12
12
|
log.audit('Before Submit', `companyname is: ${companyName}`);
|
|
13
13
|
}
|
|
14
14
|
}
|