Managing a Single Page Application from SuiteCloud Development Framework
With SuiteCloud Development Framework, you can manage the settings of single page applications (SPAs) by editing the fields on the SPA object definition XML file. These fields also correspond to fields on the Basic Info and Configuration tabs of the SPA record in the NetSuite UI.
When updating an SPA object in an SDF SuiteApp project, consider the following information:
-
From the SDF perspective, if you change the SPA ID, the object is considered a new SPA with the new ID. The SPA with the old ID is removed. However, you also need to update the URL and the SPA folder before you validate or deploy the project. Otherwise, uniqueness validation errors will be thrown.
-
You cannot create new files or folders by only updating the XML definition. When you update the XML definition to include a new file or folder, only the references are updated. You must create new files and folders using the File Cabinet, or you can create them in your IDE and deploy them to your account. For example, if you type a file or folder name incorrectly in the XML definition, this incorrectly named file or folder is not created in the project. Instead, an error is thrown because the specified file or folder cannot be found.
-
If you remove an optional field from your XML definition, the existing value is preserved and no change is applied to the field (except for links that are removed).
-
For most optional fields, if you leave the value empty, it is reset to its default value. The exception is the Boolean field
notifyowner
, which has a default value of true (T). If you leave the value for this field empty, it is changed to false (F). -
Setting the
audienceallroles
to true (T) selects all internal roles only. You can use theaudienceroles
field to individually specify internal and external roles that can run the SPA. Ifaudienceallroles
is set to true, all internal roles will be included in the audience along with any specific external roles listed inaudienceroles
.
To update an SPA object, you must have the SuiteApp project files saved in your local environment (even if you do not make changes to other files). Otherwise, when you redeploy the SuiteApp with the updated SPA object, it will fail. If you do not have these files saved locally, you can import the SPA object from a target NetSuite account into your SDF SuiteApp project and download the script files from the NetSuite File Cabinet.
To manage the settings of your SPA from SDF:
-
If you have the SuiteApp project files in your local environment, you can proceed directly to step 2. Otherwise, follow these steps to download the SuiteApp project files:
-
Import the SPA object from a target NetSuite account to your local environment.
The Download XML button is not available for SPA objects, but you can use SuiteCloud plug-ins and extensions and SuiteCloud CLI to import an SPA object from a NetSuite account. For more information, see Account Component Imports to SuiteCloud Projects.
You can import an object from a specific SuiteApp by specifying the application ID. To filter your search, select
singlepageapp
as the object type and select script IDs that containcustspa
. -
Download the SPA folder, SPA client script file, and SPA server script file, or create them in your local environment. If the
assetsfolder
field has a value in the XML definition, you also need to create an assets folder inside the SPA folder. The assets folder is not downloaded if the folder is empty.You cannot import files from a NetSuite account into a SuiteApp project. You must manually download the SuiteApp project files from the NetSuite File Cabinet or create the files in your local SuiteApp project folder.
-
-
In the SPA object definition XML file, change the fields that you want to modify. For information about the XML definition for SPA objects, see Single Page Applications as XML Definitions. For information about fields and possible values in the SPA object definition, see singlepageapp.
-
Deploy the project to your account. For more information, see SuiteCloud Project Deployment Preparation.
Note:You can apply installation preferences to SPAs. The SPA supports object locking, and hiding and locking of files. For more information about installation preferences and how to apply them, see Installation Preferences in the SuiteApp of SuiteCloud Project.