@hitc/netsuite-types 2024.2.5 → 2024.2.6
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/types.d.ts +6 -6
- package/example-UserEventScript.ts +12 -2
- package/package.json +1 -1
package/N/types.d.ts
CHANGED
|
@@ -93,10 +93,10 @@ export namespace EntryPoints {
|
|
|
93
93
|
namespace Client {
|
|
94
94
|
interface fieldChangedContext {
|
|
95
95
|
currentRecord: N_record.ClientCurrentRecord;
|
|
96
|
-
sublistId: string;
|
|
96
|
+
sublistId: string | null;
|
|
97
97
|
fieldId: string;
|
|
98
|
-
line
|
|
99
|
-
column
|
|
98
|
+
line?: number;
|
|
99
|
+
column?: number;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
type fieldChanged = (scriptContext: fieldChangedContext) => void;
|
|
@@ -117,7 +117,7 @@ export namespace EntryPoints {
|
|
|
117
117
|
|
|
118
118
|
interface postSourcingContext {
|
|
119
119
|
currentRecord: N_record.ClientCurrentRecord;
|
|
120
|
-
sublistId
|
|
120
|
+
sublistId?: string;
|
|
121
121
|
fieldId: string;
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -150,7 +150,7 @@ export namespace EntryPoints {
|
|
|
150
150
|
|
|
151
151
|
interface validateFieldContext {
|
|
152
152
|
currentRecord: N_record.ClientCurrentRecord;
|
|
153
|
-
sublistId
|
|
153
|
+
sublistId?: string;
|
|
154
154
|
fieldId: string;
|
|
155
155
|
line?: number;
|
|
156
156
|
column?: number;
|
|
@@ -528,4 +528,4 @@ export namespace EntryPoints {
|
|
|
528
528
|
interface IKeyValuePair {
|
|
529
529
|
key: string|object;
|
|
530
530
|
value: string|object;
|
|
531
|
-
}
|
|
531
|
+
}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @NAPIVersion 2.
|
|
2
|
+
* @NAPIVersion 2.1
|
|
3
3
|
* @NScriptType UserEventScript
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import {EntryPoints} from 'N/types'
|
|
7
7
|
import log = require('N/log');
|
|
8
|
+
import query = require('N/query');
|
|
8
9
|
|
|
10
|
+
// Let's assume this example is deployed to sales orders
|
|
9
11
|
export function beforeSubmit(ctx: EntryPoints.UserEvent.beforeSubmitContext) {
|
|
10
12
|
if (ctx.type == ctx.UserEventType.CREATE) {
|
|
11
|
-
|
|
13
|
+
const customerId = ctx.newRecord.getValue('entity') as string;
|
|
14
|
+
log.debug('beforeSubmit', `Submitting new transaction for entity: ${customerId}`); // When creating a transaction from an entity, log the entity internal id
|
|
15
|
+
|
|
16
|
+
// SuiteQL example
|
|
17
|
+
const results: { companyname: string }[] = query.runSuiteQL({
|
|
18
|
+
query: `SELECT companyName FROM customer WHERE id = ?`,
|
|
19
|
+
params: [customerId]
|
|
20
|
+
}).asMappedResults() as any;
|
|
21
|
+
log.debug('beforeSubmit', `Customer ${customerId} values: ${JSON.stringify(results)}`);
|
|
12
22
|
}
|
|
13
23
|
}
|
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": "2024.2.
|
|
11
|
+
"version": "2024.2.6",
|
|
12
12
|
"author": "Head in the Cloud Development <gurus@headintheclouddev.com> (www.headintheclouddev.com)",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|