Questions tagged [soql]

SOQL is the Salesforce Object Query Language.

SOQL, the Salesforce Object Query Language is a SQL like syntax used on the force.com platform to query records within a Salesforce instance. It can be used in triggers, or fully fledged Apex code, or via their web services API.

748 questions
1
vote
1 answer

Salesforce SOQL Query to access a child field in WHERE statement

I am attempting to write a query on an object, Opportunity, this object has a child object Quotes. In Quotes where have a field named, Order_Ready. What I need to do is filter in all opportunities that have approved quotes (Order_Ready__c ==…
Bryan Harrington
  • 991
  • 2
  • 17
  • 31
1
vote
1 answer

Relational SOQL in Salesforce PatronManager

I'm attempting to build an application using the Salesforce API (with custom PatronManager objects) and when I run the following "parent-to-child" query I get an error message stating that the relationship is not understood: SELECT Name, (SELECT…
Scott
  • 324
  • 2
  • 4
  • 15
1
vote
1 answer

Query Permission Sets for "Manage Flow" new summer 23 release item

Is it possible to run a query to see which permission sets the Manage Flows = True? With the new summer 23 release there is an option to be more pragmatic with the Flow Permissions in Permission Sets & Profiles (Create/Update) etc..We just want to…
J B
  • 11
  • 2
1
vote
1 answer

Apex Soql - Map Syntax

I am trying to do this: Map reqMap = new Map(); reqMap = [Select Id, TeamId from SObject]; Id and team Id are both of type Id. I don't want the entire SObject, just those two fields. I would like my map to look like: {Id = xyz, TeamId…
Riz
  • 91
  • 1
  • 6
1
vote
2 answers

Salesforce SOQL To Get Case Owner In One Hit

Using Salesforce SOQL I can get the Owner's Id using the following: SELECT Case.OwnerId FROM Case WHERE Case.CaseNumber = '00001234' I can then get the User details for the User who owns the case in this query: SELECT User.Id, User.Name,…
Fenton
  • 241,084
  • 71
  • 387
  • 401
1
vote
1 answer

Getting an entry for every client that is not the latest in SOQL

I have just created a query that gets the latest entry for every client in a custom object (see this question, with a great answer from @eyescream). SELECT id, (SELECT score__c, date__c FROM my_custom_objects__r …
Kees
  • 95
  • 10
1
vote
1 answer

How can I convert curl response from salesforce CRM into datagridview on c#?

Below is a curl response from salesforce CRM , would like to show Id, Status, Brand__c, Case_Name__c on DataGridView using c# { "totalSize": 2, "done": true, "records": [{ "attributes": { "type": "Case", …
1
vote
1 answer

How to fetch Notes related to specific Accounts in Salesforce?

How can I fetch Notes data related to a specific Account using SOQL query in Salesforce? I tried with the below SOQL query but it gives me empty rows. SELECT Id, Title, Body FROM Note WHERE ParentId = '' I am attaching a screenshot for…
1
vote
1 answer

Error while executing query for custom object Work Order

I am executing the query for my custom object created in SFDC. but i am getting the following error: {'[{"message":"\nSELECT FS_Account_Name__c from FS_Work_Order__c\ERROR at Row:1:Column:34\nsObject type 'FS_Work_Order__c' is not supported. If you…
Amol
  • 765
  • 2
  • 8
  • 12
1
vote
1 answer

Update Salesforce Case Record with SOQL in PHP

Trying to change the case owner of a specific case by changing the OwnerId value but I am not having any success.. I have compared my query with the docs and I can't understand why it's failing. The examples in the docs are for the Contact object, I…
user3436467
  • 1,763
  • 1
  • 22
  • 35
1
vote
1 answer

Query Salesforce users and their permission sets (SOQL)

i'm trying to run an SOQL query on salesforce to get all users and their permission set id. it is important the list return will be by user not by permission sets, meaning if i have 1000 users i will get back 1000 records and for each record the…
1
vote
1 answer

SOQL - Count of records where the parent hasn't had child records in 1 year

I am trying to create a SOQL query (and later a report) in Salesforce that generates the following data: Count of Child records grouped by Parent records where the Parent does not have child records created in the past year. I tried this first;…
Ryan M.
  • 23
  • 1
  • 7
1
vote
2 answers

SOQL - How to retrieve CaseNumber based on the ParentId and Name based ContactId?

I'm extracting the "Id", "CaseNumber", "ContactId" & "ParentId" variables from "Case" object: SELECT Id, CaseNumber, ContactId, ParentId FROM…
1
vote
1 answer

soql query to get list of queue/group names assigned to user

I am working on a query to get the names of each queue a user is in with a binding variable but am running into some issues with pulling both the queue and group. query: public static List getQueues(String recordId){ return [SELECT…
ForrestFairway
  • 133
  • 1
  • 11
1
vote
1 answer

Query Salesforce to return picklist values (SOQL?)

I need to query a Salesforce object to return all possible picklist values for a particular field on that object. We will then use these values to write some conditional logic to handle potential data transformations as we accept incoming data…