+ Start a Discussion
jungleeejungleee 

difference between Id and QueueId in QueueSObject

Hi All,

 

Could some please throw some light on the difference between the id and QueueID used when we query for a Queue using SOQL like Select id, SobjectType, QueueId, Queue.Name from QueueSobject.?

 

Thanks

Sameer

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

QueueSobject:Represents the mapping between a queue Group and the sObject types associated with the queue, including custom objects.Customer Portal users can't access this object.

QueueId :- (Field Description)

          Type(reference)

    Properties(Create, Filter, Group, Sort)

    Description(The ID of a queue)

 

But since the Queue Name is not unique (unlike RecordType where you can't have same RecordTypeName for an object), if there are two Queues with the same name and related to same SobjectType, the query will fail to return a single record and my assignment of OwnerId will throw an exception.

Salesforce allows you to create duplicate queue records with the same Name and related SobjectType. There will be no difference between these two records except for their Ids.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

QueueSobject:Represents the mapping between a queue Group and the sObject types associated with the queue, including custom objects.Customer Portal users can't access this object.

QueueId :- (Field Description)

          Type(reference)

    Properties(Create, Filter, Group, Sort)

    Description(The ID of a queue)

 

But since the Queue Name is not unique (unlike RecordType where you can't have same RecordTypeName for an object), if there are two Queues with the same name and related to same SobjectType, the query will fail to return a single record and my assignment of OwnerId will throw an exception.

Salesforce allows you to create duplicate queue records with the same Name and related SobjectType. There will be no difference between these two records except for their Ids.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

This was selected as the best answer
jungleeejungleee

Thanks for explanation!