A Salesforce Object Query Language (SOQL), modeled on SQL, for accessing information saved in the Salesforce database.

learn more… | top users | synonyms

0
votes
0answers
17 views

Query public calendar in apex [on hold]

I am trying to query public calendar in apex.Currently storing the ID of calendar while assigning it to Event.Any work around please
1
vote
1answer
24 views

How to select the first record from multiple records

I'm looking for some assistance in a simple SOQL statement. I haven't written SQL for over 15 years (so a real newbie to SOQL) Looking for what i believe must be a simple SOQL statement. I used SQL ...
2
votes
1answer
19 views

Is there anyway to delete a SF object record using the PHP toolkit?

I've this object relation: Group_Test__c <---> AssociationGroupOrder <--> Order So I can have a N:N realtion between Groups and Orders. I'm working with the PHP Toolkit. ...
0
votes
1answer
27 views

Need to build a single soql query for related list

I have an object Project__c where I have related list as Phase__c and Toll__c. Project__c is a lookup to Phase__c and Toll__c.Can i have a single soql query where i can have all the phase__c and ...
1
vote
3answers
35 views

SOQL Statement with Uppercase Function

Is there a uppercase function in SOQL? For example, Select uppercase(Country_Name__c) from Account; I need to match user input (Country_Name__c) to my Map and return market. It only works if ...
2
votes
1answer
25 views

find fields which are null for all records on object

I am writing some business rules which expect data to be captured properly in many fields while record creation. Most of the fields for most of the records are blank and not captured by user. We need ...
1
vote
1answer
34 views

query sObject or Custom setting by multiple fields

i need to implement logic at couple of places which is like querying an sObject or a custom setting. There are input fields using which i need to create filter criteria to reach appropriate records in ...
1
vote
2answers
166 views

SOQL Injection Solutions Help - (Used esacapeSingleQuotes(str) - gives error = no viable alternative at character '\' )

I am facing some issues with following SOQL Query : My Scanner result gave me SOQL Injection Errors, can anyone help in fixing those - I am going throw lots of Google Search and Stuff, but it will ...
0
votes
1answer
23 views

how to Query parent to child

I have process in salesforce in such a way opportunity we can relate this opportunity to this lookup field parent_opportunity__c . Which relates opportunity to other parent opportunity. I want to ...
0
votes
1answer
28 views

Retrieve earliest record from each Grand child object

I have 3 objects, Object A, Object B and Object C. Object B is a child of Object A, while Object C is a child of object B. I am trying to access the all the single earliest records of all records in ...
1
vote
1answer
18 views

Want last month data in Query but SOQL giving error is it supported?

This is my query. i want last report date data. SELECT ErrorCategory__c FROM Score__c where reportdate__C=(select max(reportdate__C) from Score__c)
2
votes
1answer
14 views

Describe call returns fields that error in SOQL

The describe call is returning a bunch of fields on Account such as BillingLatitude, BillingLongitude, PhotoUrl, etc that result in the following error when included in SOQL queries: No such ...
1
vote
2answers
16 views

How to get contentData and ContentFileName for FeedComment Post

Can anyone tell me how to get the contentData and contentFileName for FeedComment ? I can get same for FeedItem using below query. [select ...
0
votes
2answers
44 views

Active User and their related Tasks SOQL

I want to fetch the list of Active User and their list of Task. Following Query working for me to fetch all task with thier User select Id, Subject, Status, OwnerId, ...
1
vote
2answers
29 views

Is there a way to filter a Task SOQL query by lead sources associated with their contacts and/or leads?

My objective is to pull all emails that have a contact or lead as outbound. As a result, I have the following three queries: Q1 = "select ID,leadsource from Lead where LeadSource LIKE ...
0
votes
1answer
25 views

More than One value from pick list

I have to get records whose picklist value is x and y. I wrote a sqol in developer console I am not getting result. If I do separate search for x and y. I am getting result. else I am not getting any ...
-2
votes
1answer
49 views

Caching SOQL Query Results - with a List of Id's in the condition

How do I write a utility method to cache the SOQL results with a List of Id's in the where clause as below: List<Id> accOwnerIds = new List<Id>(); Map<Id, User> mapUser= [select id, ...
5
votes
2answers
80 views

QueryException: Non-selective query against large object type for custom object with no records

I have a custom object in a managed package that currently has no records in the customers org. Lets call it DFB__ProductUdfMap__c (namespaces etc... have been changed to protect the innocent). The ...
1
vote
2answers
23 views

SOQL Statement to Query Field Level Security on particular Profiles

I am looking to see if it is possible to compare field level security between profiles using a SOQL statement. Is this possible please?
1
vote
0answers
6 views

How to get multiple values of ContentDocument.LatestPublishedVersionId

Can anyone tell me how to get multiple values of ContentDocument.LatestPublishedVersionId? Accessing the Chatter Attachments Via ContentDocumentLink seems to work fine for project using the query . ...
0
votes
0answers
29 views

Bulk API : Querying multiple objects in parallel

I am working on retrieving all the records for a few set of objects such as Accounts, Contacts, Account Partner, and a few custom objects, etc. I have obtained all the fields through the describe() ...
1
vote
2answers
17 views

Getting Id of the files to feedItem and feedcomment

Can anyone tell me how to get the id of the feedItem files? Like I want to know the id(ContentDocument.LatestPublishedVersionId) of the files that are attached to the feeditem and feedcomment. Please ...
3
votes
1answer
117 views

Multiple SUM results in single query

I have a custom object object__c which has three fields total_1__c, total_2__c and total_3__c. I want to query on all object__c records to get SUM of total_1__c,total_2__c and total_3__c. It can be ...
0
votes
1answer
15 views

How to update relevant records in visual page when an button is clicked?

I created VF page which displays top 10 drivers based on thier driving efficiency(Soql query). when the particular driver in the list clicks HOW?( To tell how they achieved that position) button a ...
3
votes
0answers
32 views

No such column 'HasCommentsUnreadByOwner'/'HasSelfServiceComments' on entity 'Case'

I'm facing an issue with Case field 'HasCommentsUnreadByOwner' and 'HasSelfServiceComments'. When I execute the query in an apex class or query editor: Select Id, HasSelfServiceComments, ...
1
vote
1answer
12 views

how to find a word in url column in a given object

I am looking for SOQL/SOSL to find records in object having a URL column with some filter(text in column( on URL column, tries like and sosl, both doesn't work. Any help ?
1
vote
1answer
42 views

getting “System.QueryException: List has no rows for assignment to SObject” error with custom setting in non-test code

I am trying to leverage a custom setting to bypass some validation for a specific update in some APEX. This is not test code coverage so I do not need to create the record first, I should simply be ...
1
vote
1answer
12 views

Is it possible to exclude every user's personal documents in a SOQL query?

It's relatively straight forward to exclude the current user's personal documents, but what about excluding all personal documents, i.e. SELECT ... FROM Document WHERE FolderId != <any User Id>? ...
2
votes
1answer
31 views

How to show a Case Feed within a Visualforce page where the Case Id is dynamic?

I am currently trying to expand upon the Web-To-Case functionality by exposing certain updates to our users. When trying to do this I would need a way for them to enter their case number, then pull ...
0
votes
1answer
24 views

Get image attachments with apex

I would like to display the the first image attachment for a record in my visualforce page. The visualforce page uses a standard controller to get the record data and I've built an extension to ...
1
vote
1answer
21 views

How to Retrieve current case id when the trigger is fired?

The problem is when status is closed in case.New case should be created.But the problem is it gets more cases whose status is closed with the parent id.I need the case which is closed for ...
4
votes
1answer
44 views

Using a literal string in SELECT statement

Is there an equivalent SOQL syntax to write following SQL? SELECT Id, 'Northwind Category' AS Note FROM categories
1
vote
1answer
53 views

Query Retention Email based on Data Extension in ExactTarget

I need to create an automation in ExactTarget which would send Emails to inactive consumers "x" (e.g. 100 days) days after subscribers make it to the Data Extension. Inactive means: subscribers ...
1
vote
1answer
30 views

Same apex method different output

I have "Items" object with different statuses. I need to get the following output with single soql query. Ordered Items: 10 Cancelled Items: 3 Reviewed Items: 2 VF Page and apex code below: ...
0
votes
0answers
35 views

what is difference between lightning component and bootstrap?

Iam new to salesforce .can anyone please let me know difference between lightning component and bootstrap? and what are the different error are in SOQL in salesforce?
1
vote
1answer
57 views

Using apex value retrived from Visualforce page in SOQL Query

Please help me figure out a way on how to solve this. The below query gives me error : Error: Compile Error: Didn't understand relationship 'contactData' in field path. If you are attempting to ...
-1
votes
1answer
29 views

ANSWERED: SOQL Returned Sets Inside Of Cells - Not Sure What To Do Next With Apex

I am working with 3 SalesForce objects: Enrollment_New__c, Application_Checklist__c, and Opportunity. Application_Checklist__c and Opportunity are both in a "child" relationship to the parent ...
1
vote
1answer
44 views

SOQL query returning empty list

I'm trying to query for a custom object. In the query editor in the Developer console, this query returns 1 row. SELECT Id, Name FROM Household_Served__c LIMIT 1000 But then when I code it in ...
0
votes
2answers
58 views

Trigger checkbox when Insert/Update

I would like to update the checkbox field 'New' to false when there's a new record inserted or updated when the colID is more than the previous colID. For instance: My record as shown: ProdID = 1 ...
0
votes
2answers
37 views

Trigger after insert, before update

Im trying to create a Trigger on my Products. Would like to update the New checkbox field to false if the col is more than the newly inserted col and if the checkbox field is true. However the trigger ...
1
vote
3answers
41 views

Display distinct record in Visualforce

APEX CONTROLLER: productInvList = new list<ProductInventory__c> (); inv =[Select ProductID__r.Name,ProductID__r.Launch__c, ProductID__r.ProductID__c, ProductID__r.More_Colors__c, ...
2
votes
2answers
47 views

SOQL to get all Leads that were created on particular date or range

I am trying to a REST call from java and trying to query LEAD entity to get all Leads that were created on a particular date/date range. I am unable to get working query for the same. I am doing ...
0
votes
1answer
51 views

How to retrieve records from two objects which has lookup relationship?

I have Custom object DriverEfficiency__c which has (contact(lookup),Car_Meter_Reading__c,Efficiency_Rating__c,Fuel_Liter__c) fields. The Problem is I need to create a Vf Page to retrieve records from ...
0
votes
1answer
31 views

Convert trigger to apex class

I have two custom objects. The first stores transactional data with a externally generated customer ID. The second custom object maps this customer ID to a salesforce account ID. I'm trying to find ...
1
vote
1answer
32 views

List controllers are not supported for Order Item

I am trying to create a custom EDIT ALL list button on OrderItem (Order Product) with content source as Visualforce page and am getting below error. I don't want to use standard EDIT ALL button as I ...
1
vote
1answer
97 views

Getting SOQL/SOSL Injection error when I send my code for security review

I have send my code for security review I am getting error for SOQL/SOSL Injection. I have made the changes on the bases they have mention in report. But even I am getting issue with dynamic soql I am ...
0
votes
2answers
30 views

SOQL: Compare result of Date Function with Date Literal in Where Clause

Say I have a query that goes something like this: Currency_Exchange_Rates__c cerRec = [SELECT Currency_Code__c, Exchange_Rate_Period__c, Exchange_Rate__c FROM Currency_Exchange_Rates__c WHERE ...
2
votes
1answer
25 views

Wrapper object and SOQL on Event and Accounts

I'm new to salesforce, apex and visualforce so please forgive me if I'm asking a dumb question. I'd like to have into a visualforce page a list of all events and related account (if any) of the ...
1
vote
2answers
128 views

System.LimitException: Too many query rows: 50001 for Test Class

I have come across this error in production but in a test class where I am defining 5 rows only , how come I'm facing this error ? Also there was no error in QA but error in Dev and Prod. ...
0
votes
0answers
38 views

Apex CPU time limit exceeded error for batch apex

I want to implement a batch sequence that takes a query of all the Territory Managers in the company and mark the top 15 Accounts as Focus Accounts. The Territory Owners field is a text field. The ...