Entity Group

The entity group record helps you use scripting to work with groups of employees, contacts, customers, partners or vendors.

For help working with this record in the UI, see Working with Groups.

The internal ID for this record is entitygroup.

This record contains the following subrecords:

This record contains the following sublist: testCell.

Note:

For information about using the SuiteScript Records Browser, see Working with the SuiteScript Records Browser in the NetSuite Help Center.

Supported Script Types

The entity group record is scriptable in both client and server SuiteScript.

Supported Functions

The entity group record supports the following functions: create, read, update, delete, and search. The following functions aren't supported: copy and transform.

Prerequisites

You must enable the Marketing Automation feature before you can use this record with SuiteScript. For more information, see Marketing Automation Overview.

To use all the fields on this record, you must enable the following features: Mail Merge, Team Selling, Customer Support and Service, Sales Force Automation, Issue Management, Manufacturing Routing and Work Center, Billing Operations, Subsidiaries, and Personalized Catalog Views.

Additional Details

Consider the following when using this record with SuiteScript:

  • Fields listed in the Notes, Files, Events, and Workflows tabs in the UI aren't scriptable.

  • The bulkMerge and campaign sublists aren't scriptable.

  • Not all fields can be populated at the same time. Each group type (for example: Employee, Customer, Vendor, Sales Team) supports different fields and may require different features. You can use the UI to see which fields are supported.

Code Samples

The following samples show common actions with entity group scripting.

Create script example:

              var record = nlapiCreateRecord('entitygroup', true);
record.setFieldValue('groupname', 'Test entity group');
record.setFieldValue('groupowner', '303');
record.setFieldValue('comments', 'test comments');
...
record.selectNewLineItem('testcell');
record.setCurrentLineItemValue('testcell', 'name', 'test cell');
record.setCurrentLineItemValue('testcell', 'percentage', '10');
record.commitLineItem('testcell');
...
var recordId = nlapiSubmitRecord(record); 

            

Update script example:

              record = nlapiLoadRecord('entitygroup', recordId);
record.setFieldValue('description', 'Test description updated');
record.setFieldValue('comments', 'test comments  updated');
…
record.removeLineItem('testcell', 1);
record.selectNewLineItem('testcell');
record.setCurrentLineItemValue('testcell', 'name', 'test cell 2');
record.setCurrentLineItemValue('testcell', 'percentage', '20');
record.commitLineItem('testcell');
…
recordId = nlapiSubmitRecord(record); 

            

Delete script example:

              nlapiDeleteRecord('entitygroup', recordId); 

            

Related Topics

General Notices