Finding Record Type and Field Names
SuiteQL queries include references to record types and fields. For example, the following SuiteQL string queries for entityid
field values that are included in employee records:
SELECT employee.entityid AS entityidRAW FROM employee
To create a query using SuiteQL, you must know the names of the record types and fields that you want to use in your query. You can find these names in several ways:
Using the NetSuite UI
On the Customization tab, you can see the IDs of the available record types and fields. For example, to see the IDs for custom CRM fields, go to Customization > Lists, Records, & Fields > CRM Fields (Administrator). The ID column appears in the list of custom fields.
Using the SuiteAnalytics Workbook UI
You can use the SuiteAnalytics Workbook UI to find record type and field names. SuiteAnalytics Workbook uses the same data source that SuiteQL does (the analytics data source), so you can use the SuiteAnalytics Workbook UI to explore the available record types and fields before you create your query.
To find record type and field names using the SuiteAnalytics Workbook UI:
-
In your NetSuite account, click the Analytics tab in the NetSuite navigation menu.
-
On the Workbooks page, click New Workbook.
-
Search for the record type that you want to use as the root record of your query.
The name of each supported record type is listed in the Record ID column. You can use this page to find all supported record type names, but you cannot use this page to find field names. If you need to find field names, continue to step 4.
-
Click a record type. A workbook is created with the selected record type as the root record.
The left column lists the record types that you can join with the root record. The middle column lists the fields that are available on the selected record.
-
In the middle column, find the field that you want to use in your query. Hover over the field, and click the information button.
Information about the field is displayed. The field name is listed under Field ID. You can also see the type of data that the field contains (text, date, boolean, and so on).
If you want to find field names for fields that are on a different root record, repeat this procedure from step 2 and choose a new root record. To learn more about creating workbooks, see SuiteAnalytics Workbook Tutorial.
Using the Export Option from SuiteAnalytics Workbook
When you use SuiteAnalytics Workbook, you can export your saved dataset definitions to a SuiteQL TXT file. This allows you to understand how fields are joined in your dataset so that you can build your SuiteQL queries.
When using the exported SuiteQL file, ensure that you use the same user and role used for the export with SuiteAnalytics Workbook. The export option is only available for users that have the AnalyticsAdmin permission assigned to their roles. For more information about Permissions, see Setting Permissions.
For information about how to export your dataset definitions, see Exporting Dataset Definitions to SuiteQL.
Using the Records Catalog
You can use the Records Catalog to see the fields and joins available for each record type when you use the following channels:
-
If you are using the N/query module in SuiteScript and SuiteAnalytics Workbook.
-
If you are using SuiteAnalytics Connect with the NetSuite2.com data source.
Note:The Records Catalog is supported for the SuiteScript Analytic API and the REST Query API only. Therefore, the record types available in the Records Catalog and the record types accessible through the Connect Service may differ slightly.
The Records Catalog displays information such as the cardinality, field level help, and the feature and permission requirements for each record type. The Records Catalog relies on NetSuite role-based permissions, so you can see only the record types for the data that you can access in the NetSuite user interface.
The Records Catalog is available for all users that have the Records Catalog permission assigned to their role. For more information, see Records Catalog Overview.
See the following topics:
-
For information about the SuiteScript Analytic APIs, see SuiteScript 2.x Analytic APIs.
-
For information about SuiteAnalytic Connect, see Record Types and Fields.