### Output examples for suitecloud account:setup:ci
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_81134826821.html
Example output from running the account:setup:ci command. The first output is for setting up an account; the second is for selecting an existing auth ID.
```text
The authentication was successful with the following account and role: My account name [Developer]. This project will use the authentication ID "myAuthId" as default.
```
```text
The authentication ID was successfully changed. This project will use the auth ID "myAuthId" as default.
```
--------------------------------
### Deploy File that Executes the SDF Installation Script Example
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1554821440.html
Deploy file for the SDF installation script example. It deploys objects from the v4 folder to the target account, then objects from the v41 folder. The installation script (customscript_install_script.xml with deployment customdeploy1) executes at the end of deployment. Note the example as written contains a malformed closing tag.
```xml
~/FileCabinet/SuiteApps/com.example/*
~/Objects/v4/*
~/Objects/v41/*
```
--------------------------------
### Run suitecloud account:setup (Syntax / Example)
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_89132630266.html
This command runs the account:setup command for the current SuiteCloud project. In this example, interactive mode is not enabled as a flag, but it is illustrative of the basic syntax without options.
```bash
suitecloud account:setup
```
--------------------------------
### crypto.createSecretKey(options) syntax example
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4358653390.html
Shows the syntax for crypto.createSecretKey(options). It is not a functional example; it demonstrates the required parameters: encoding (using encode.Encoding.UTF_8) and guid. The guid must be a string that can be a GUID or script ID of a secret stored at Setup > Company > API Secrets. When using the crypto.SecretKey object for an AES algorithm, the length of the text used to generate the GUID must be 16, 24, or 32 characters.
```javascript
//Add additional code
...
var secretKey = crypto.createSecretKey({
encoding: encode.Encoding.UTF_8,
guid: '284CFB2D225B1D76FB94D150207E49DF'
});
...
//Add additional code
```
--------------------------------
### GET request showing initial state of a record instance
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/chapter_1545142407.html
This GET request shows the initial state of a record instance used as the starting point for all examples in this section. It includes a keyed sublist and an unkeyed sublist with sample lines.
```http
GET .../myrecord/100
{
"body1": "previous body text 1",
"body2": "previous body text 2",
"sublist" : {
"items" : [
{ "key1": "a", "key2": "1", "col": "previously present line 1" },
{ "key1": "b", "key2": "2", "col": "previously present line 2" },
{ "key1": "X", "key2": "0", "col": "previously present line 0" },
]
},
"unkeyedsublist" : {
"items" : [
{ "col": "previously present line 1" },
{ "col": "previously present line 2" },
{ "col": "previously present line 0" },
]
}
}
```
--------------------------------
### Example commands for suitecloud account:setup:ci
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_81134826821.html
Example commands for setting up an account and selecting an existing auth ID. The first command uses all required options; the second selects an existing auth ID as the default for the SuiteCloud project.
```bash
suitecloud account:setup:ci --authid myAuthId --certificateid iozrrinfw18oa4quy23gmlzcgkfo25ixx60ha0w6cxf --privatekeypath d:/path/private-key.pem --account 1234567
```
```bash
suitecloud account:setup:ci select myAuthId
```
--------------------------------
### project:create output example
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156041348327.html
Sample output after successfully creating an Account Customization Project. It indicates the project location, instructs to run suitecloud setupaccount to link the project with the account, and notes that a sample unit test was added in the __tests__ folder.
```text
The account customization project was created successfully in C:\sdfProjects\MyACP.
Go to C:\sdfProjects\MyACP and run "suitecloud setupaccount" to link your project with your account.
A sample unit test has been added in the "__tests__" folder of your project.
```
--------------------------------
### GET /services/rest/record/v1/website?q=displayName START_WITH "My website"
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_0220092558.html
Finds a website by name using a search query. The example searches for websites whose displayName starts with "My website".
```APIDOC
## GET /services/rest/record/v1/website?q=displayName START_WITH "My website"
### Description
Finds a website by name using a search query.
### Method
GET
### Endpoint
/services/rest/record/v1/website
### Parameters
#### Query Parameters
- **q** (string) - Required - Search query expression. Example: displayName START_WITH "My website"
### Request Example
GET {{COMPANY_URL}}/services/rest/record/v1/website?q=displayName START_WITH "My website"
### Response
#### Success Response (200)
Returns a list of website records matching the search criteria.
#### Response Example
(Not provided in source)
```
--------------------------------
### SQL % wildcard for prefix match
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N637092.html
Use the SQL % wildcard to select columns that begin with certain characters. For example, to see customers in Minneapolis and Minnetonka, use the SQL % wildcard to get all cities starting with 'Minn'.
```sql
SELECT * FROM Customers WHERE City LIKE 'Minn%';
```
--------------------------------
### Output of successful suitecloud account:setup
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_89132630266.html
This is an example output after successfully running the account:setup command. It shows the authenticated company/role, which account ID is set as default, and how to change default credentials. It also confirms the account setup succeeded.
```text
The account has been authenticated for the following company and role: DB 9006 OneWorld for My Account Name [Developer]. This project will use the authentication ID "myDevRole" as default. If you want to change your default credentials, run "suitecloud account:setup" again.
The account has been successfully set up.
```
--------------------------------
### GET response translations sublist example
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_0301085014.html
Example of a GET response for the translations sublist. The locale field is accessed as a subrecord.
```json
'translations': {
'items': [
{
'locale': { 'id': 'es_ES' },
'description': 'updated description',
'displayName': 'updated displayName',
'language': 'Spanish',
'pageTitle': 'updated pageTitle'
}
]
}
```
--------------------------------
### startConfig()
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_7101941729.html
Documentation for the startConfig() function, including syntax, parameters, return value, and usage examples.
```APIDOC
## startConfig()
### Description
Opens the configuration interface for a specified product using the provided information. Builds a URL based on the product identifier (either code or internal ID) and can open the product in a new tab, current window, or popup window.
### Syntax
```
startConfig({
id: number, // Use id OR code
code: string,
target: 'self' | 'tab' | 'window',
data: any,
params: {
paramName1: string | number,
paramName2: string | number,
paramName3: string | number
}
});
```
### Parameters
- **id** (number) - Optional - Specifies the internal ID of the product to open. Found in the **ID** field on the product record. Takes priority over `code` if provided.
- **code** (string) - Optional - Specifies the code of the product to open. Found in the **Code** field on the product record. Resolves to an internal NetSuite ID if `id` is not provided.
- **target** (string) - Optional - Determines where the product interface opens. Values: `tab` (default, new browser tab), `self` (current window), `window` (popup window).
- **params** (object) - Optional - An object containing additional query string parameters to append to the product URL.
- **data** (any) - Optional - An object representing initial form data available in the product configuration.
### Return Value
Returns `false` if the provided parameters are incomplete or the product cannot be found. Otherwise, opens the specified product interface and returns `undefined`.
### Examples
#### Opening a Product in a New Tab with a Custom Parameter
```
startConfig({
code: 'CPQ001',
target: 'tab',
params: { customParam: 'abc123' }
});
```
#### Opening a Product in a Popup Window
```
startConfig({
id: 24531,
target: 'window',
data: { quantity: 5 }
});
```
```
--------------------------------
### SDF Installation Script: Get Custom Script Parameter
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_156383279814.html
Example of an SDF installation script that retrieves a custom script parameter using the N/runtime module. The run function is the entry point defined by the SDF deployment. The parameter name 'custscript1' must match a custom script field on the script record.
```javascript
/**
* @NApiVersion 2.0
* @NScriptType SDFInstallationScript
*/
define(['N/runtime'], function(runtime) {
function run(params) {
var customParam = runtime.getCurrentScript().getParameter({name: 'custscript1'});
}
return {
run: run
};
});
```
--------------------------------
### https.Method syntax example
Source: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4567626997.html
Syntax example for the https.Method enum. Use this enum to set the method parameter in https.request(options). The example shows the GET value; other supported values are DELETE, GET, HEAD, PUT, POST, and PATCH. This is not a functional example; see N/https Module Script Samples for a complete script.
```javascript
// Add additional code
...
var response = https.request({
method: https.Method.GET,
url: 'https://www.testwebsite.com'
});
...
// Add additional code
```