UNPKG

@btonasse/suitescript-types

Version:
1,215 lines (1,188 loc) 164 kB
declare global { /** UI Object page type used to build multi-step "assistant" pages to simplify complex workflows. All data and state for an assistant is tracked automatically throughout the user's session up until completion of the assistant. */ interface NLObjAssistant { /** * Add a field to this page and return it. * @param {string} name field name * @param {string} type field type * @param {string} label field label * @param {number|string} source script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields * @param {string} group group name that this field will live on. If empty then the field is added to the main section of the page */ addField(name: string, type: string, label?: string, source?: number | string, group?: string): NLObjField; /** * Add a field group to the page. * @param {string} name field group name * @param {string} label field group label */ addFieldGroup(name: string, label: string): NLObjFieldGroup; /** * Add a step to the assistant. * @param {string} name the name of the step * @param {string} label label used for this step */ addStep(name: string, label: string): NLObjAssistantStep; /** * Add a sublist to this page and return it. For now only sublists of type inlineeditor are supported * @param {string} name sublist name * @param {string} type sublist type (inlineeditor only for now) * @param {string} label sublist label */ addSubList(name: string, type: string, label: string): NLObjSubList; /** * Return an array of the names of all field groups on this page. */ getAllFieldGroups(): string[]; /** * Return an array of the names of all fields on this page. */ getAllFields(): string[]; /** * Return an array of all the assistant steps for this assistant. */ getAllSteps(): NLObjAssistantStep[]; /** * Return an array of the names of all sublists on this page . */ getAllSubLists(): string[]; /** * Return current step set via nlobjAssistant.setCurrentStep(step) */ getCurrentStep(): NLObjAssistantStep; /** * Return a field on this page. * @param {string} name field name */ getField(name: string): NLObjField; /** * Return a field group on this page. * @param {string} name field group name */ getFieldGroup(name: string): NLObjFieldGroup; /** * Return the last submitted action by the user: next|back|cancel|finish|jump */ getLastAction(): string; /** * Return step from which the last submitted action came from */ getLastStep(): NLObjAssistantStep; /** * Return the next logical step corresponding to the user's last submitted action. You should only call this after * you have successfully captured all the information from the last step and are ready to move on to the next step. You * would use the return value to set the current step prior to continuing. */ getNextStep(): NLObjAssistantStep; /** * Return an assistant step on this page. * @param {string} name step name */ getStep(name: string): NLObjAssistantStep; /** * Return the total number of steps in the assistant. */ getStepCount(): number; /** * Return a sublist on this page. * @param {string} name sublist name */ getSubList(name: string): NLObjSubList; /** * Return true if the assistant has an error message to display for the current step. */ hasError(): boolean; /** * Return true if all the steps have been completed. */ isFinished(): boolean; /** * Redirect the user following a user submit operation. Use this to automatically redirect the user to the next logical step. * @param {NLObjResponse} response The response object used to communicate back to the user's client */ sendRedirect(response: NLObjResponse): void; /** * Mark a step as current. It will be highlighted accordingly when the page is displayed * @param {NLObjAssistantStep} step Assistant step object representing the current step that the user is on. */ setCurrentStep(step: NLObjAssistantStep): void; /** * Set the error message for the current step. * @param {string} html Error message (rich text) to display on the page to the user. */ setError(html: string): void; /** * Set the values for all the fields on this page. * @param {Object} values Object of field name/value pairs used to set all fields on page. */ setFieldValues(values: Object): void; /** * Mark assistant page as completed and optionally set the rich text to display on completed page. * @param {string} html Completion message (rich text) to display on the "Finish" page. */ setFinished(html: string): void; /** * If numbered, step numbers are displayed next to the step's label in the navigation area. * @param {boolean} numbered If true (default assistant behavior) step numbers will be displayed next to the step label. */ setNumbered(numbered: boolean): void; /** * If ordered, steps are show on left and must be completed sequentially, otherwise steps are shown on top and can be done in any order * @param {boolean} ordered If true (default assistant behavior) then a navigation order thru the steps/pages will be imposed on the user. Otherwise the user will be allowed to navigate across steps/pages in any order they choose. */ setOrdered(ordered: boolean): void; /** * Set the script ID for Client Script used for this form. * @param {string|number} script Script ID or internal ID for global client script used to enable Client SuiteScript on page. */ setScript(script: string | number): void; /** * Show/hide shortcut link. Always hidden on external pages. * @param {boolean} show Enable/disable "Add To Shortcut" link on this page. */ setShortcut(show: boolean): void; /** * Set the splash screen used for this page. * @param {string} title splash portlet title * @param {string} text1 splash portlet content (left side) * @param {string} text2 splash portlet content (right side) */ setSplash(title: string, text1: string, text2?: string): void; /** * Set the page title. * @param {string} title */ setTitle(title: string): void; } /** Assistant Step Definition. Used to define individual steps/pages in multi-step workflows. */ interface NLObjAssistantStep { /** * Return an array of the names of all fields entered by the user during this step. */ getAllFields(): string[]; /** * Return an array of the names of all sublist fields entered by the user during this step * @param {string} group sublist name */ getAllLineItemFields(group: string): string[]; /** * Return an array of the names of all sublists entered by the user during this step. */ getAllLineItems(): string[]; /** * Return the value of a field entered by the user during this step. * @param {string} name field name */ getFieldValue(name: string): string; /** * Return the selected values of a multi-select field as an Array entered by the user during this step. * @param {string} name multi-select field name */ getFieldValues(name: string): string[]; /** * Return the number of lines previously entered by the user in this step (or -1 if the sublist does not exist). * @param {string} group sublist name */ getLineItemCount(group: string): number; /** * Return the value of a sublist field entered by the user during this step. * @param {string} group sublist name * @param {string} name sublist field name * @param {number} line sublist (1-based) */ getLineItemValue(group: string, name: string, line: number): string; /** * Return the index of this step in the assistant page (1-based). */ getStepNumber(): number; /** * Set helper text for this assistant step. * @param {string} help inline help text to display on assistant page for this step */ setHelpText(help: string): NLObjAssistantStep; /** * Set the label for this assistant step. * @param {string} label display label used for this assistant step */ setLabel(label: string): void; } /** Buttons used for triggering custom behaviors on pages. */ interface NLObjButton { /** * Disable or enable button. * @param {boolean} disabled If true then this button should be disabled on the page. */ setDisabled(disabled: boolean): NLObjButton; /** * Set the label for this button. * @param {string} label display label for button */ setLabel(label: string): NLObjButton; /** * Sets the button as hidden in the UI. This API is supported on custom buttons and on some standard NetSuite buttons * @param {boolean} visible Defaults to true if not set. If set to false, the button will be hidden in the UI. */ setVisible(visible: boolean): NLObjButton; } interface NLObjCache { get(key: string): string; /** * @param {string} key * @param {string} value * @param {number} ttl, time to live in seconds. */ put(key: string, value: string, ttl: number): Object; remove(key: string): Object; } /** For columns used on scriptable lists and list portlets. */ interface NLObjColumn { /** * Add a URL parameter (optionally defined per row) to this column's URL. * * @param {string} param the name of a parameter to add to URL * @param {string} value the value of the parameter to add to URL -or- a column in the datasource that returns the parameter value for each row * @param {boolean} perRow if true then the 2nd arg is expected to be a column in the datasource */ addParamToURL(param: string, value: string, perRow?: boolean): void; /** * Set the header name for this column. * * @param {string} label The label for this column. */ setLabel(label: string): void; /** * Set the base URL (optionally defined per row) for this column. * * @param {string} value the base URL or a column in the datasource that returns the base URL for each row * @param {boolean} perRow if true then the 1st arg is expected to be a column in the datasource */ setURL(value: string, perRow?: boolean): void; } /** For interacting with setup/configuration pages. */ interface NLObjConfiguration { /** * Return an Array of all field names on the record. */ getAllFields(): string[]; /** * Return the type corresponding to this setup record. */ getType(): string; /** * Return field metadata for field. * * @param {string} fldnam field name */ getField(fldnam: string): NLObjField; /** * Return the text value of a field. * @restriction only supported for select fields * * @param {string} name field name */ getFieldText(name: string): string; /** * Return the selected text values of a multi-select field as an Array. * @param {string} name field name */ getFieldTexts(name: string): string[]; /** * Return the value of a field. * * @param {string} name field name */ getFieldValue(name: string): string; /** * Return the selected values of a multi-select field as an Array. * @restriction only supported for multi-select fields * * @param {string} name field name */ getFieldValues(name: string): string[]; /** * Set the value of a field. * * @param {string} name field name * @param {string} value field value */ setFieldValue(name: string, value: string): void; /** * Set the values of a multi-select field. * @restriction only supported for multi-select fields * * @param {string} name field name * @param {string[]} values field values */ setFieldValues(name: string, values: string[]): void; /** * Set the value (via display value) of a field. * @restriction only supported for select fields * * @param {string} name field name * @param {string} text field display text */ setFieldText(name: string, text: string): void; /** * Set the values (via display values) of a multi-select field. * @restriction only supported for multi-select fields * * @param {string} name Field name. * @param {string[]} texts Array of field display text values. */ setFieldTexts(name: string, texts: string[]): void; } /** Utility class providing information about the current user and the script runtime. */ interface NLObjContext { /** * Return the account ID of the current user. */ getCompany(): string; /** * Return the deployment ID for the current script. */ getDeploymentId(): string; /** * Return the internalId of the current user's department. */ getDepartment(): number; /** * Return the email address of the current user. */ getEmail(): string; /** * Return the environment that the script is executing in: SANDBOX, PRODUCTION, BETA, INTERNAL. */ getEnvironment(): string; /** * Return the execution context for this script: webServices|csvImport|client|userInterface|scheduledScript|portlet|suitelet|debugger|custommassupdate */ getExecutionContext(): string; /** * Return true if feature is enabled, false otherwise. * @param {string} name */ getFeature(name: string): boolean; /** * Return the internalId of the current user's location. */ getLocation(): number; /** * Return the logging level for the current script execution. Not supported in CLIENT scripts. */ getLogLevel(): string; /** * Return the name of the current user. */ getName(): string; /** * Return the % complete specified for the current scheduled script execution. */ getPercentComplete(): number; /** * Return current user's permission level (0-4) for this permission. * @param {string} name */ getPermission(name: string): number; /** * Return system or script preference selection for current user. * @param {string} name */ getPreference(name: string): string; /** * Returns the number of scheduled script queues in a given account. */ getQueueCount(): number; /** * Return the amount of usage units remaining for this script. */ getRemainingUsage(): number; /** * Return the internalId of the current user's role. */ getRole(): string; /** * Return the internalId of the current user's center type. */ getRoleCenter(): string; /** * Return the script ID of the current user's role. */ getRoleId(): string; /** * Return the script ID for the current script. */ getScriptId(): string; /** * Return value of session object set by script. * @param {string} name */ getSessionObject(name: string): string; /** * Return a system/script setting. Types are SCRIPT, SESSION, FEATURE, PERMISSION. * * @param {string} type * @param {string} name * */ getSetting(type: string, name: string): string; /** * Return the internalId of the current user's subsidiary. */ getSubsidiary(): number; /** * Return the internalId of the current user. */ getUser(): string; /** * Return the NetSuite version for the current account. */ getVersion(): string; /** * Set the % complete for the current scheduled script execution. * @param {number} pct The percentage of records completed */ setPercentComplete(pct: number): void; /** * Set the value of a session object using a key. * @param {string} name * @param {string} value */ setSessionObject(name: string, value: string): void; /** * Set a system/script setting. Only supported type is SESSION. * * @param {string} type * @param {string} name * @param {string} value * * @deprecated */ setSetting(type: string, name: string, value: string): void; } /** * Return a new instance of nlobjCredentialBuilder * * @classDescription The nlobjCredentialBuilder object encapsulates a request string that can be passed to nlapiRequestURLWithCredentials(credentials, url, postdata, headers, httpsMethod). * @param {string} request can include an embedded GUID (globally unique string). * @param {string} domain URL’s host name. Host name must exactly match the host name in your URL. * * @constructor */ function nlobjCredentialBuilder(request: string, domain: string): NLObjCredentialBuilder; interface NLObjCredentialBuilder { /** * Appends a passed in string to an nlobjCredentialBuilder object. * * @param {string} string String to be appended. */ append(string: string): NLObjCredentialBuilder; /** * Encodes an nlobjCredentialBuilder object per the base64 scheme. */ base64(): NLObjCredentialBuilder; /** * Hashes an nlobjCredentialBuilder object with the MD5 hash function. */ md5(): NLObjCredentialBuilder; /** * Replaces all instances of string1 with string2. * * @param {string} string1 String to be replaced * @param {string} string2 String to be replaced with */ replace(string1: string, string2: string): NLObjCredentialBuilder; /** * Hashes an nlobjCredentialBuilder object with the SHA-256 hash function. */ sha256(): NLObjCredentialBuilder; /** * Encodes an nlobjCredentialBuilder object per the UTF-8 scheme. */ utf8(): NLObjCredentialBuilder; } interface NLObjCSVImport { /** * Sets the data to be imported in a linked file for a multi-file import job, by referencing a file in the file cabinet using nlapiLoadFile(id), or by inputting CSV data as raw string. * * @param {string} sublist The internal ID of the record sublist for which data is being imported. * @param {string|NLObjFile} file Raw data or nlobjFile object containing CSV data. */ setLinkedFile(sublist: string, file: string | NLObjFile): NLObjCSVImport; /** * Sets the name of the saved import map to be used for an import, by referencing the internal ID or script ID of the import map. * * @param {string} savedImport The internal ID or script ID of the saved mapping to use for the import job. */ setMapping(savedImport: string): void; /** * Sets the name of the saved import map to be used for an import, by referencing the internal ID or script ID of the import map. * * @param {string} option The name of the option; in this case, jobName. * @param {string} value The value for the jobName option, meaning the text to be displayed in the Job Name column at Setup > Import/Export > View CSV Import Status. */ setOption(option: string, value: string): void; /** * Sets the data to be imported in the primary file for an import job, by referencing a file in the file cabinet using nlapiLoadFile, or by inputting CSV data as raw string. * * @param {string|NLObjFile} file Raw data or nlobjFile object containing CSV data. */ setPrimaryFile(file: string | NLObjFile): void; /** * Sets the data to be imported in the primary file for an import job, by referencing a file in the file cabinet using nlapiLoadFile, or by inputting CSV data as raw string. * * @param {string} queue The new queue number. Valid values range from '1' to '5', depending upon the SuiteCloud License. */ setQueue(queue: string): void; } interface NLObjDuplicateJobRequest { setEntityType(entityType: string): void; setMasterId(masterID: string): void; setMasterSelectionMode(masterSelectionMode: string): void; setOperation(operation: string): void; setRecords(dupeRecords: string[]): void; } interface NLObjEmailMerger { /** * Perform the merge and return an object containing email subject and body. * @governance 20 units */ merge(): { subject: string; body: string }; /** * Associate a custom record to the merger. * @param {string} recordType type of the custom record * @param {number} recordId ID of the record to be associated with the merger */ setCustomRecord(recordType: string, recordId: number): void; /** * Associate an entity to the merger. * @param {string} entityType type of the entity (customer/contact/partner/vendor/employee) * @param {number} entityId ID of the entity to be associated with the merger */ setEntity(entityType: string, entityId: number): void; /** * Associate a second entity (recipient) to the merger. * @param {string} recipientType type of the entity (customer/contact/partner/vendor/employee) * @param {number} recipientId ID of the entity to be associated with the merger */ setRecipient(recipientType: string, recipientId: number): void; /** * Associate a support case to the merger. * @param {number} caseId ID of the support case to be associated with the merger */ setSupportCase(caseId: number): void; /** * Associate a transaction to the merger * @param {number} transactionId ID of the transaction to be associated with the merger */ setTransaction(transactionId: number): void; } /** * Return a new instance of nlobjError used system or user-defined error object. * * @classDescription Encapsulation of errors thrown during script execution. * * @constructor */ function nlobjError(): NLObjError; interface NLObjError { /** * Return the error code for this system or user-defined error. */ getCode(): string; /** * Return the error description for this error. */ getDetails(): string; /** * Return the error db ID for this error (if it was an unhandled unexpected error). */ getId(): string; /** * Return the internalid of the record if this error was thrown in an aftersubmit script. */ getInternalID(): number; /** * Return a stacktrace containing the location of the error. */ getStackTrace(): string[]; /** * Return the userevent script name where this error was thrown. */ getUserEvent(): string; } interface NLObjField { /** * Add a select option to this field (valid for select/multiselect fields). This method is only supported on scripted fields via the UI Object API. * * @param {string} value internal ID for this select option * @param {string} text display value for this select option * @param {boolean} selected if true then this select option will be selected by default */ addSelectOption(value: string, text: string, selected?: boolean): void; /** * Return field label. */ getLabel(): string; /** * Return field name. */ getName(): string; /** * This method can only be used in server contexts against a record object. Also note that a call to this method may return different results for the same field for different roles. * * @param {string} filter A search string to filter the select options that are returned. * @param {string} filteroperator Supported operators are contains | is | startswith. If not specified, defaults to the contains operator. */ getSelectOptions(filter?: string, filteroperator?: string): NLObjSelectOption[]; /** * Return field type. */ getType(): string; /** * Set the alias used to set the value for this field. Defaults to field name. This method is only supported on scripted fields via the UI Object API. * * @param {string} alias Column used to populate the field (mostly relevant when populating sublist fields). */ setAlias(alias: string): NLObjField; /** * Set the break type (startcol|startrow|none) for this field. startrow is only used for fields with a layout type of outside. This method is only supported on scripted fields via the UI Object API. * * @param {string} breaktype Break type used to add a break in flow layout for this field: startcol | startrow | none. */ setBreakType(breaktype: string): NLObjField; /** * Set the default value for this field. This method is only supported on scripted fields via the UI Object API. * * @param {string} value */ setDefaultValue(value: string): NLObjField; /** * Set the width and height for this field. This method is only supported on scripted fields via the UI Object API. * * @param {number} width * @param {number} height */ setDisplaySize(width: number, height?: number): NLObjField; /** * Set the display type for this field. This method is only supported on scripted fields via the UI Object API * * @param {string} type display type: inline|normal|hidden|disabled|readonly|entry */ setDisplayType(type: string): NLObjField; /** * Set help text for this field. If inline is set on assistant pages, help is displayed inline below field. This method is only supported on scripted fields via the UI Object API. * * @param {string} help Field level help content (rich text) for field. * @param {string} inline If true then in addition to the popup field help, the help will also be displayed inline below field (supported on assistant pages only). */ setHelpText(help: string, inline?: boolean): NLObjField; /** * Set the label for this field. This method is only supported on scripted fields via the UI Object API. * * @param {string} label */ setLabel(label: string): NLObjField; /** * Set the layout type and optionally the break type. This method is only supported on scripted fields via the UI Object API * * @param {string} type Layout type: outside|startrow|midrow|endrow|normal * @param {string} breaktype Break type: startcol|startrow|none */ setLayoutType(type: string, breaktype?: string): NLObjField; /** * Set the text that gets displayed in lieu of the field value for URL fields. * * @param {string} text user-friendly display value in lieu of URL */ setLinkText(text: string): NLObjField; /** * Make this field mandatory. This method is only supported on scripted fields via the UI Object API * * @param {boolean} mandatory if true then field becomes mandatory */ setMandatory(mandatory: boolean): NLObjField; /** * Set the maxlength for this field (only valid for certain field types). This method is only supported on scripted fields via the UI Object API. * * @param {number} maxLength maximum length for this field */ setMaxLength(maxLength: number): NLObjField; /** * Set the amount of empty vertical space (rows) between this field and the previous field. This method is only supported on scripted fields via the UI Object API. * * @param {number} padding # of empty rows to display above field */ setPadding(padding: number): NLObjField; } interface NLObjFieldGroup { /** * Set collapsibility property for this field group. * * @param {boolean} collapsible if true then this field group is collapsible * @param {boolean} defaultcollapsed if true and the field group is collapsible, collapse this field group by default */ setCollapsible(collapsible: boolean, defaultcollapsed?: boolean): NLObjFieldGroup; /** * Set the label for this field group. * @param {string} label display label for field group */ setLabel(label: string): NLObjFieldGroup; /** * Set showBorder property for this field group. * * @param {boolean} showBorder If true then this field group shows border including label of group. */ setShowBorder(showBorder: boolean): NLObjFieldGroup; /** * Set singleColumn property for this field group. * * @param {boolean} singleColumn if true then this field group is displayed in single column */ setSingleColumn(singleColumn: boolean): NLObjFieldGroup; } interface NLObjFile { /** * Return the file description. */ getDescription(): string; /** * Return the internal ID of the folder that this file is in. */ getFolder(): number; /** * Return the id of the file (if stored in the FC). */ getId(): number; /** * Return the name of the file. */ getName(): string; /** * Return the size of the file in bytes. */ getSize(): number; /** * Return the type of the file. */ getType(): string; /** * Return the URL of the file (if stored in the FC). */ getURL(): string; /** * Return the value (base64 encoded for binary types) of the file. */ getValue(): string; /** * Return true if the file is inactive. */ isInactive(): boolean; /** * Return true if the file is "Available without Login". */ isOnline(): boolean; /** * Sets the file's description. * @param {string} description the file description */ setDescription(description: string): void; /** * Sets the character encoding for the file. * @param {string} encoding */ setEncoding(encoding: string): void; /** * Sets the internal ID of the folder that this file is in. * @param {number} folder */ setFolder(folder: number): void; /** * Sets the file's inactive status. * @param {boolean} inactive */ setIsInactive(inactive: boolean): void; /** * Sets the file's "Available without Login" status. * @param {boolean} online */ setIsOnline(online: boolean): void; /** * Sets the name of a file. * @param {string} name the name of the file. */ setName(name: string): void; } interface NLObjForm { /** * Add a button to this form. * * @param {string} name button name * @param {string} label button label * @param {string} script button script (function name) */ addButton(name: string, label: string, script: string): NLObjButton; /** * Adds a field that lets you store credentials in NetSuite to be used when invoking services provided by third parties. * * @param {string} id The internal ID of the credential field. * @param {string} label The UI label for the credential field. * @param {string} website The domain the credentials can be sent to. * @param {string} scriptId The scriptId of the script that is allowed to use this credential field. * @param {string} value If you choose, you can set an initial value for this field. This value is the handle to the credentials. * @param {boolean} entityMatch Controls whether use of nlapiRequestUrlWithCredentials with this credential is restricted to the same entity that originally entered the credential. * @param {string} tab The tab parameter can be used to specify either a tab or a field group (if you have added nlobjFieldGroup objects to your form). */ addCredentialField( id: string, label: string, website?: string, scriptId?: string, value?: string, entityMatch?: boolean, tab?: string ): NLObjField; /** * Add a field (nlobjField) to this form and return it. * * @param {string} name field name * @param {string} type field type * @param {string} label field label * @param {string|number} sourceOrRadio Script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields * @param {string} tab Tab name that this field will live on. If empty then the field is added to the main section of the form (immediately below the title bar). */ addField(name: string, type: string, label: string, sourceOrRadio?: string | number, tab?: string): NLObjField; /** * Add a field group to the form. * @param {string} name field group name * @param {string} label field group label * @param {string} tab */ addFieldGroup(name: string, label: string, tab?: string): NLObjFieldGroup; /** * Add a navigation cross-link to the page. * * @param {string} type page link type: crosslink|breadcrumb * @param {string} title page link title * @param {string} url URL for page link */ addPageLink(type: string, title: string, url: string): void; /** * Add a reset button to this form. * * @param {string} label Label for this button. defaults to "Reset". */ addResetButton(label?: string): NLObjButton; /** * Add a sublist (nlobjSubList) to this form and return it. * * @param {string} name sublist name * @param {string} type sublist type: inlineeditor|editor|list|staticlist * @param {string} label sublist label * @param {string} tab parent tab that this sublist lives on. If empty, it is added to the main tab */ addSubList(name: string, type: string, label: string, tab?: string): NLObjSubList; /** * Add a submit button to this form. * * @param {string} label Label for this submit button. Defaults to "Save". */ addSubmitButton(label?: string): NLObjButton; /** * Add a subtab (nlobjTab) to this form and return it. * * @param {string} name subtab name * @param {string} label subtab label * @param {string} tab parent tab that this subtab lives on. If empty, it is added to the main tab. */ addSubTab(name: string, label: string, tab?: string): NLObjTab; /** * Add a tab (nlobjTab) to this form and return it. * * @param {string} name tab name * @param {string} label tab label */ addTab(name: string, label: string): NLObjTab; /** * Get a button from this form by name. * @param {string} name Button Id. */ getButton(name: string): NLObjButton; /** * Return a field (nlobjField) on this form. * * @param {string} name field name * @param {string} radio If this is a radio field, specify which radio field to return based on radio value. */ getField(name: string, radio?: string): NLObjField; /** * Return a sublist (nlobjSubList) on this form. * * @param {string} name sublist name */ getSubList(name: string): NLObjSubList; /** * Return a subtab (nlobjTab) on this form. * * @param {string} name subtab name */ getSubTab(name: string): NLObjTab; /** * Return a tab (nlobjTab) on this form. * * @param {string} name Tab name. */ getTab(name: string): NLObjTab; /** * Get a list of all tabs. */ getTabs(): string[]; /** * Insert a field (nlobjField) before another field (name). * * @param {NLObjField} field The field object to insert. * @param {string} nextfld The name of the field before which to insert this field. */ insertField(field: NLObjField, nextfld: string): NLObjField; /** * Insert a sublist (nlobjSubList) before another subtab or sublist (name). * * @param {NLObjSubList} sublist The sublist object to insert. * @param {string} nextsublist The name of the sublist before which to insert this sublist. */ insertSubList(sublist: NLObjSubList, nextsublist: string): NLObjSubList; /** * Insert a subtab (nlobjTab) before another subtab or sublist (name). * * @param {NLObjTab} subtab The subtab object to insert. * @param {string} nextsubtab The name of the subtab before which to insert this subtab. */ insertSubTab(subtab: NLObjTab, nextsubtab: string): NLObjTab; /** * Insert a tab (nlobjTab) before another tab (name). * * @param {NLObjTab} tab the tab object to insert * @param {string} nexttab the name of the tab before which to insert this tab */ insertTab(tab: NLObjTab, nexttab: string): NLObjTab; /** * Removes an nlobjButton object. This method can be used on custom buttons and certain built-in NetSuite buttons. * @param {string} name */ removeButton(name: string): void; /** * Set the values for all the fields on this form. * * @param {Object} values Object containing field name/value pairs */ setFieldValues(values: Object): void; /** * Set the Client Script definition used for this page. * * @param {string|number} script Script ID or internal ID for global client script used to enable Client SuiteScript on page */ setScript(script: string | number): void; /** * Set the page title. * * @param {string} title */ setTitle(title: string): void; } interface NLObjFuture { cancel(): boolean; getId(): string; isCancelled(): boolean; isDone(): boolean; } interface NLObjJobManager { createJobRequest(): NLObjJobRequest; getFuture(): NLObjFuture; submit(request: NLObjJobRequest): string; } interface NLObjJobRequest {} interface NLObjList { /** * Add a column (nlobjColumn) to this list and return it. * * @param {string} name column name * @param {string} type column type * @param {string} label column label * @param {string} align column alignment */ addColumn(name: string, type: string, label: string, align?: string): NLObjColumn; /** * Add an Edit column (nlobjColumn) to the left of the column specified. * * @param {NLObjColumn} column * @param {boolean} showView should Edit|View instead of Edit link * @param {string} showHref column that evaluates to T or F that determines whether to disable the edit|view link per-row. */ addEditColumn(column: NLObjColumn, showView: boolean, showHref?: string): NLObjColumn; /** * Add a navigation cross-link to the page. * * @param {string} type page link type: crosslink|breadcrumb * @param {string} title page link title * @param {string} url URL for page link */ addPageLink(type: string, title: string, url: string): void; /** * Add a row (Array of name-value pairs or nlobjSearchResult) to this portlet. * * @param {string[]|NLObjSearchResult} row data used to add a single row */ addRow(row: string[] | NLObjSearchResult): void; /** * Add multiple rows (Array of nlobjSearchResults or name-value pair Arrays) to this portlet. * * @param {string[][]|NLObjSearchResult[]} rows data used to add multiple rows */ addRows(rows: string[][] | NLObjSearchResult[]): void; /** * Set the Client SuiteScript used for this page. * * @param {string|number} script script ID or internal ID for global client script used to enable Client SuiteScript on page */ setScript(script: string | number): void; /** * Set the global style for this list: grid|report|plain|normal. * * @param {string} style overall style used to render list */ setStyle(style: string): void; /** * Set the page title. * * @param {string} title */ setTitle(title: string): void; } interface NLObjLogin { /** * @param {string} currentPassword * @param {string} newEmail new Email * @param {boolean} justThisAccount indicates whether to apply email change only to roles within this account or apply email change to its all NetSuite accounts and roles */ changeEmail(currentPassword: string, newEmail: string, justThisAccount: boolean): void; /** * @param {string} currentPassword * @param {string} newPassword New Password. */ changePassword(currentPassword: string, newPassword: string): void; } interface NLObjMergeResult { /** * Use this method to get the body of the email distribution in string format. */ getBody(): string; /** * Use this method to get the subject of the email distribution in string format. */ getSubject(): string; } interface NLObjPivotColumn { /** * Get the column alias. */ getAlias(): string; /** * Get the column hierarchy. */ getColumnHierarchy(): NLObjPivotColumn; /** * Get dependency for specified alias. */ getDependency(alias: string): Object; /** * Get the column label. */ getLabel(): string; /** * Get the summary line. */ getSummaryLine(): NLObjPivotColumn; } interface NLObjPivotRow { /** * Get the row alias. */ getAlias(): string; /** * Get the children rows if there are any. */ getChildren(): NLObjPivotRow[]; /** * Get the opening line. */ getOpeningLine(): NLObjPivotRow; /** * Get the parent row. */ getParent(): NLObjPivotRow; /** * Get the summary line from the report. */ getSummaryLine(): NLObjPivotRow; } interface NLObjPivotTable { /** * Get the parent column. */ getParent(): NLObjPivotColumn; /** * Get the row hierarchy. */ getRowHierarchy(): NLObjPivotRow; } interface NLObjPivotTableHandle { /** * Get the pivot table object from the report definition. */ getPivotTable(): NLObjPivotTable; /** * Returns the completion status flag of the report definition execution. */ isReady(): boolean; } interface NLObjPortlet { /** * Add a column (nlobjColumn) to this LIST portlet and return it. * * @param {string} name column name * @param {string} type column type * @param {string} label column label * @param {string} align column alignment */ addColumn(name: string, type: string, label: string, align?: string): NLObjColumn; /** * Add an Edit column (nlobjColumn) to the left of the column specified (supported on LIST portlets only). * * @param {NLObjColumn} column * @param {boolean} showView should Edit|View instead of Edit link * @param {string} showHref column that evaluates to T or F that determines whether to disable the edit|view link per-row. */ addEditColumn(column: NLObjColumn, showView: boolean, showHref?: string): NLObjColumn; /** * add a field (nlobjField) to this FORM portlet and return it. * * @param {string} name field name * @param {string} type field type * @param {string} label field label * @param {string|number} source Script ID or internal ID for source list (select and multiselects only) -or- radio value for radio fields */ addField(name: string, type: string, label?: string, source?: string | number): NLObjField; /** * Add a line (containing text or simple HTML) with optional indenting and URL to this LINKS portlet. * * @param {string} text data to output to line * @param {string} url URL if this line should be clickable (if NULL then line will not be clickable) * @param {number} indent Number of indents to insert before text */ addLine(text: string, url?: string, indent?: number): void; /** * Add a row (nlobjSearchResult or Array of name-value pairs) to this LIST portlet. * * @param {string[]|NLObjSearchResult} row */ addRow(row: string[] | NLObjSearchResult): void; /** * Add multiple rows (A