singlepageapp

This topic provides information about the available fields for singlepageapp SDF custom objects.

For information about developing single page applications (SPAs) as part of SDF SuiteApp projects, see Single Page Applications.

For additional information about the SPA object definition file, see Single Page Applications as XML Definitions.

Feature Dependencies

  • SERVERSIDESCRIPTING

Attributes

Name

Type

Required / Optional

Description

scriptid

string

Required

The ID of the single page application (SPA).

Ensure that:

  • The value starts with the prefix custspa.

  • It is in lowercase.

  • It contains only alphanumeric characters and underscores (”_”).

  • It is unique.

  • It matches the name of the SPA object XML file.

This attribute value can be up to 28 characters long.

The default value is ‘custspa’.

Fields

Name

Type

Required / Optional

Description

name

string

Required

Name of the SPA. This name is the value that appears in the list of SPAs.

This field value can be up to 1000 characters long.

url

string

Required

Custom part of the URL where the SPA is executed.

Ensure that:

  • It is in lowercase.

  • It is unique.

  • It does not contain any of the following characters because they are URL reserved symbols: ! * ' ( ) ; : @ & = +$ , / ? # [ ].

  • It does not contain the following characters: ` { } ^ " | < > %. When these characters are used, the URL returns a Bad Request error.

  • It does not contain spaces.

This field value can be up to 1000 characters long.

clientscriptfile

filereference

Required

Location of the SPA client script. This script runs the application in the browser.

Ensure that:

  • It is limited to 199 characters including the file extension.

  • The path points to a location inside the SPA folder.

  • The path specified must be relative to the src/FileCabinet/ folder.

This field must reference a .js file.

serverscriptfile

filereference

Required

Location of the SPA server script. This script runs on the server before the application is served to the browser.

Ensure that:

  • It is limited to 199 characters including the extension.

  • The path points to a location inside the SPA folder.

  • The path specified must be relative to the src/FileCabinet/ folder.

This field must reference a .js file.

folder

folderreference

Required

Location of the folder that contains all SPA components.

Ensure that:

  • The path points to a location inside the /src/FileCabinet/SuiteApps/<publisherid>.<projectid>/ folder.

  • The path specified must be relative to the src/FileCabinet/ folder.

  • The folder is unique.

  • The folder name is limited to 99 characters.

  • The folder name does not contain any of the following characters: ? * < > | ' \\.

  • The folder name does not contain any of these characters that are not handled well by the File Cabinet: ! : / \.

description

string

Optional

Description of the SPA.

This field value can be up to 1000 characters long.

assetsfolder

folderreference

Optional

Location of the folder that contains a set of assets (such as style sheets, images, and subfolders). This assets folder is optional and, if available, must be located inside the SPA folder.

The assets in this folder are accessible through the SPA asset endpoint /spa-app/<ApplicationId>/<SpaFolder>/assets/<path_to_asset>, where <path_to_asset> is the relative path to the asset file within the assets folder.

Ensure that:

  • The folder name is limited to 99 characters.

  • The folder name does not contain any of the following characters: ? * < > | ' \\.

  • The folder name does not contain these characters that are not handled well by the File Cabinet: ! : / \.

  • The path specified must be relative to the src/FileCabinet/ folder.

audienceallroles

boolean

Optional

Indicates whether all internal roles can run SPA-related scripts. It can be set to T or F. If it is set to T, all internal roles are included in the audience along with any specific external roles listed in audienceroles.

If you remove this field, but audienceroles is also set (even if audienceallroles was set to T) the audience is updated to the value in audienceroles.

The default value is F.

loglevel

single-select list

Optional

Sets the log level.

For information about possible values, see script_loglevel.

The default value is 'DEBUG'.

audienceroles

multi-select list

Optional

List of roles that can run the SPA.

For example, to list a custom role and the standard developer role, specify: <audienceroles>[appid=com.example.spa, scriptid=customrole_example_role]|DEVELOPER</audienceroles>.

If audienceallroles is set to T, all internal roles are included in the audience along with any specific external roles listed in audienceroles.

You can specify multiple values by separating each value with a pipe (|) symbol.

This field accepts references to the role custom type.

For information about other possible values, see generic_role.

executeas

single-select list

Optional

Sets the user role used when executing SPA. The default value is 'CURRENT ROLE'.

The ADMINISTRATOR role cannot be used.

This field refers to the role used to run the SPA server script. The SPA in the browser will always run based on the role of the currently logged in user.

This field accepts references to the role custom type.

For information about other possible values, see generic_role.

usesuif

boolean

Optional

This field must always be set to T. It indicates that NetSuite UIF libraries are used when running SPAs.

The default value is T.

notifyadmins

boolean

Optional

Indicates whether all administrators are notified about errors. Can be set to T or F.

The default value is F.

notifyowner

boolean

Optional

Indicates whether the script owner is notified about errors. Can be set to T or F.

The default value is T.

notifyuser

boolean

Optional

Indicates whether the current user is notified about errors. Can be set to T or F.

The default value is F.

notifyemails

string

Optional

List of email addresses for users that must be notified about errors.

Ensure that:

  • It references valid email addresses.

  • The list of email addresses is separated by commas.

This field value can be up to 999 characters long.

Structured Fields

Structured fields are elements that usually contain subfields or groups of fields. They are similar to regular fields but have their own embedded structure. The following structured fields are supported:

General Notices