---
schema_version: "1"
id: 36ef104ef5b453651cb974e502df276be655de90e93c934d411f113fa3ff25c5
title: createNewGroup Method
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-createnewgroup-method.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-createnewgroup-method.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3c62a852bbf491246cecf09a3a8e31d122798ca6b62756b36321b3a41300aaeb
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# createNewGroup Method

Creates a new (Quote or Order)-group with or without the corresponding Group Quote or Group Order record.

<!-- Section title is the name of the method followed by "Method". If appropriate, precede the method name with the class name and a colon.-->

## Class

<!-- broken link-->

<!-- Link(s) to the class(es) to which this method belongs. If more than one class implements the same interface, use an itemized list. Don't use a link if the class itself isn't documented for users, but do list the class name.-->


## Input Parameters

<!-- If this method has separate input and output parameters, split this section into two sections titled "Input Parameters" and "Output Parameters". Some methods of classes that implement VlocityOpenInterface2 might require an "Options Parameters" section as well.-->

| Parameter                 | Required                           | Description                                                         |
| ------------------------- | ---------------------------------- | ------------------------------------------------------------------- |
| parentId                  | Required                           | Opportunity ID.                                                     |
| contextId                 | Required                           | Parent cart Id (Master/Enterprise Quote/Order Id)                   |
| groupName                 | Required                           | Name for the group.                                                 |
| groupDescription          | Optional                           | Description of the group.                                           |
| cartType                  | Optional: Defaults to Quote        | Quote or Order.                                                     |
| memberType                | Optional: Defaults to ServicePoint | CPQ Group Member Type Name. For example: ServicePoint.              |
| isGroupAssociatedWithCart | Optional: Defaults to true         | True value will create the corresponding Group-Cart record as well. |

## Output Parameters

| Parameter | Description                                                                                                                 |
| --------- | --------------------------------------------------------------------------------------------------------------------------- |
| groupId   | Group ID of the created record.                                                                                             |
| groupInfo | All details related to a group. This contains groupCart, parentId, contextId, groupCartId, and groupName. See sample output |
| message   | In case of any error.                                                                                                       |

## Example Input Data

<!-- This is usually JSON, but it could be XML or a single value. For methods of classes implementing VlocityOpenInterface2 that have options parameters, include those here.-->

```
{"groupName":"South Group","groupDescription":"All south region","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","memberType":"ServicePoint","isGroupAssociatedWithCart":true,"cartType":"Quote"}"parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","pageSize":20,"offset":0,"memberType":"ServicePoint","cartType":"Quote"}
```

## Example Output Data

<!-- This is usually JSON, but it could be XML or a single value. Salesforce uses Return Type, but this takes care of that.-->

```
{"groupInfo":{"groupCart":{"attributes":{"type":"Quote","url":"/services/data/v49.0/sobjects/Quote/0Q00b000000znU2CAI"},"Name":"South Group","OpportunityId":"0060b00000vGbYbAAK","RecordTypeId":"0120b000000hxEhAAI","Pricebook2Id":null,"h_cpq_ecomm__PriceListId__c":null,"h_cpq_ecomm__DefaultServiceAccountId__c":"0010b00002ccljKAAQ","h_cpq_ecomm__DefaultBillingAccountId__c":"0010b00002ccljKAAQ","h_cpq_ecomm__ParentQuoteId__c":"0Q00b000000znTYCAY","h_cpq_ecomm__NumberOfContractedMonths__c":null,"Status":"Draft","Id":"0Q00b000000znU2CAI","h_cpq_ecomm__QuoteGroupId__c":"a4M0b000002CWMaEAO"},"groupCartURL":"apex/h_cpq_ecomm__MultiServiceHybridCPQ?id=0Q00b000000znU2CAI&parentId=0060b00000vGbYbAAK&groupCart=true&groupId=a4M0b000002CWMaEAO&contextId=0Q00b000000znTYCAY&cartType=Quote","groupCartId":"0Q00b000000znU2CAI","parentId":"0060b00000vGbYbAAK","contextId":"0Q00b000000znTYCAY","groupId":"a4M0b000002CWMaEAO","groupName":"South Group"},"groupId":"a4M0b000002CWMaEAO","error":"OK"}
```
