Create a RESTlet Schema
Call the CreateRestletSchema stored procedure to create a view schema for a RESTlet. The stored procedure outputs the schema; schemas are defined in .rsd files. You can customize the column names with a text editor -- see the following section.
Below is an example of the stored procedure inputs. You must also set the Location connection property to point to a folder location where you would like the schema saved.
EXEC CreateRESTletSchema @TableName='MyRESTletSchema', @ScriptId='548', @DeploymentNum='1', @FlattenSelects='true', @UseLabels='true', @SearchId='customsearch795'
Note that you must provide at a minimum the TableName, ScriptId (obtained from the deployment URL), DeploymentNum (obtained from the deployment URL), and SearchId. FlattenSelects and UseLabels are optional.
• FlattenSelects: Set this parameter to false if your saved search includes multiselect columns. This parameter controls how the adapter models the data types of selects (such as an entity / customer reference). When FlattenSelects is set to false, multiselect data is returned as a JSON aggregate. By default the adapter exposes two columns for selects -- one for the name and one for the value (often an Id). This will not work correctly if your saved search includes multiselect columns. There is nothing in the RESTlet metadata that distinguishes multiselect from single-select columns.
• UseLabels: This determines if the adapter should try to match column names to what would show up in the Saved Search results or just use the API name returned by the saved search itself. Note that even when UseLabels is set to true, names will be converted to be alphanumeric with underscores. Also, be aware that sometimes labels will come back with identical names for saved searches. In these cases, a number will be appended to the duplicate names to keep the names unique.
Execute the RESTlet
After connecting with Location set, you can retrieve data from the table with a simple SELECT query. For example:
SELECT * FROM MyRESTletSchema
Note: Paging is handled automatically by the NetSuite Adapter.