• JP Seabury @ Comcast
  • NEWBIE
  • 0 Points
  • Member since 2010

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

USE CASE: I've queried a record from an object that contains a multiselect picklist field (Region__c):


Employee__c bsc = [SELECT id, Division__c, Region__c , User__c FROM Employee__c
WHERE User__c = :UserInfo.getUserId()];


Now, I want to pull all of the selected values of that Multiselect picklist field into a String[], so I can use that in another query.

The following query doens't work because bsc.Region__c is not a string -- but how can I query to see if Order__c.State__c is a member of bsc.Region__c?

oldestOrder = [SELECT id FROM Order__c
WHERE OwnerId = :q.QueueId AND
Status__c NOT IN :ignoreStatus AND
State__c IN :bsc.Region__c
ORDER BY First_Submit_Date__c

LIMIT 500][0].id;

USE CASE: I've queried a record from an object that contains a multiselect picklist field (Region__c):


Employee__c bsc = [SELECT id, Division__c, Region__c , User__c FROM Employee__c
WHERE User__c = :UserInfo.getUserId()];


Now, I want to pull all of the selected values of that Multiselect picklist field into a String[], so I can use that in another query.

The following query doens't work because bsc.Region__c is not a string -- but how can I query to see if Order__c.State__c is a member of bsc.Region__c?

oldestOrder = [SELECT id FROM Order__c
WHERE OwnerId = :q.QueueId AND
Status__c NOT IN :ignoreStatus AND
State__c IN :bsc.Region__c
ORDER BY First_Submit_Date__c

LIMIT 500][0].id;