1

So in testing, I've figured out that a queue is a type of Group. I'm trying to POST a new group, then change its Type from "regular" to "queue", but in doing so, I get this error message:

Unable to create/update fields: Type. Please check the security settings of this field and verify that it is read/write for your profile or permission set.

Is there anyway I can either change the Group type from "regular" to "queue" OR just create it as a new Queue by default, through the API?

If its not available through the API, would there be a way to create an Apex trigger that would change the group type to "queue" (instead of "regular") after creation?

1 Answer 1

2

The type field is createable, but not updateable. You must make the group as a queue in order to have it work as a queue. Afterwards, you can insert the GroupMember and QueueSObject records to specify the users and roles, and available sobjects for the queue.


You'll want to take a look at the "Sobject Tree" resource to help you create this data. Here's an example:

POST /services/data/v43.0/composite/tree/Group HTTP/1.1
Host: mydomain.my.salesforce.com
Authorization: Bearer mysessionid
Content-Length: 372
Content-Type: application/json; charset=UTF-8
Accept: application/json

{
    "records": [
        {
            "attributes": { "type": "Group", "referenceId": "queueReference" },
            "DeveloperName": "SuperQueue",
            "Name": "SuperQueue",
            "Type": "Queue",
            "QueueSobjects": {
                "records": [
                    {
                        "attributes": { "type": "QueueSobject", "referenceId": "queueCaseSObject" },
                        "SObjectType": "Case"
                    }
                ]
            }
        }
    ]
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .