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

Script that 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.

This field must reference a .js file.

serverscriptfile

filereference

Required

Script that 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.

This field must reference a .js file.

folder

folderreference

Required

Folder that contains all SPA components.

Ensure that:

  • The path points to a location inside the /src/FileCabinet/SuiteApps/<publisherid>.<projectid>/ 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

Optional folder located inside the SPA folder from the File Cabinet containing a set of assets (such as style sheets, images, subfolders).

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: ! : / \.

audienceallroles

boolean

Optional

Indicates whether any role can execute SPA-related scripts.

Can be set to T or F. If it is set to true, the audienceroles list is ignored.

If you remove this field, but audienceroles is also set (even if audienceallroles was set to true) 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 true, the audienceroles list is ignored.

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 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