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

learn more… | top users | synonyms

1
vote
1answer
97 views

Pass a String in Select query - SOQL

I have a String that contains some custom fields of Account. I want to pass a String in a Select query like this : String myString = 'myCustomField1__c, myCustomField2__c'; List<Account> ...
0
votes
1answer
17 views

Need Better Search Conditions on Duplicate VF Page [on hold]

I have an apex class that brings up duplicates when a user enters in an account name in the search box on the visualforce page. Right now, the search takes the exact letters written into the search ...
0
votes
2answers
25 views

SOQL question - Select Opportunities based on Contact Fields

I am trying to generate a query in APEX related to the Opportunity and Contact objects. I want to select Opportunities based on the info contained in the FirstName field of the linked Contact. In ...
2
votes
1answer
19 views

Getting data in the respective columns

I need to retrieve this specific columns with their expected data values from SOQL resultset when I execute the following SOQL query select SI_Old_Product_ID__c , Name, (Select Name ...
2
votes
2answers
15 views

Query Opportunity Tasks from developer console

I want id's of tasks related to Opportunity. I tried below in developer console query editor, select id,createdDate from Task where whatid like '006%' But its giving me error, ...
1
vote
1answer
42 views

Getting Custom Object Tab ID Edit page

I'm designing a custom Visualforce page and I am trying to create a link that when clicked, will take the user to the custom object tab's edit page. I have included pictures below to show what I'm ...
3
votes
2answers
133 views

Dynamically populate title based on description

I am working on a full customer portal but have run into a slight issue. I have to put a title on every page that is dynamic and can easily be changed by someone who does not code. I would like to ...
0
votes
1answer
27 views

Query request was running for too long [closed]

SOQL : SELECT Id, WhoId, WhatId, Subject, ActivityDate, Status, Priority, OwnerId, Description, CurrencyIsoCode, IsDeleted, AccountId, IsClosed, CreatedDate, CreatedById, LastModifiedDate, ...
1
vote
0answers
19 views

How to test SOQL Query performance for Communities User

I am experiencing performance issues on my Production instance with SOQL queries being executed by a Communities user. I'd like to finetune the SOQL Query performance and have done some tests in the ...
5
votes
1answer
48 views

How to execute a dynamic SOQL query with a variable number of “in” terms?

I understand from answers like this Bind variable with dotted name not working in dynamic SOQL that binding Apex variables into dynamic SOQL is more limited than into static SOQL. I want to write ...
2
votes
1answer
63 views

Bind variables only allowed in apex code

I have two objects with Master-Detail relationship between them where Phase is Master Object and Phase Entity is Child object.I am trying to compare the data(field values) in eclipse.But I am getting ...
1
vote
1answer
44 views

updating a field value based on a calculation

I have a slightly tricky situation in visualforce. I have a Forecast__c table, which contains field called District_Forecast__c. As the name suggests, this field contains revenue forecast at ...
2
votes
1answer
50 views

Is this class thread-safe?

I'm trying to prevent race conditions while adding sequential legs to these transactionIDs. Does this look like a thread-safe implementation? // only interact with TransactionCount__c using ...
7
votes
3answers
490 views

How to select a field from a nested query in junction object

Attached is a small schema of 3 objects in my org Opportunity custom object: license Junction object: opportunity and license While I have the oppty id, I need to get ALL licenses that are ...
2
votes
1answer
40 views

Correct Date format for Developer Console Query Editor?

I'm trying to debug a SOQL query in the developer console's query editor. This works SELECT Site__c, Cluster__c, Date__c, Num_Att_records__c FROM Session__c Where Session__c.SiteProgram__r.Name = ...
4
votes
2answers
167 views

Apex bulk coding style to update a field from a list of queried records

public class SOupdate{ public void display(){ List<invoice_statement__c> inv = [Select Status__c From Invoice_statement__c ...
1
vote
1answer
41 views

How to Apply a DateTime Filter when using SOQL via REST API

I'm working on a ASP.NET application which is calling our salesforce org via REST API. There is a feature to search data based on time period(DateTime field) as follows. Today Yesterday Last 7 days ...
2
votes
1answer
28 views

activity aggregate relationships only allow security evaluation for non-admin users when a single parent record is evaluated

I am getting the following error when I run a Salesforce SOQL query with a standard account. Query: SELECT ( SELECT Id, Subject FROM OpenActivities ORDER BY ActivityDate ASC , LastModifiedDate DESC ...
8
votes
3answers
95 views

Multiple Geolocation targets within a single SOQL query

Afternoon, I need to search for all objects within X miles of a set of known geo-located lat-longs. I've been looking at the geolocation features of SF but I don't see any mention of using multiple ...
3
votes
1answer
60 views

SOSL FIND verses SOQL WHERE

Is there any way to convert SOSL Find clause into SOQL where clause ? For example following SOSL and SOQL both have same filter criteria. SOSL: FIND {'ABC' and 'XYZ'} IN ALL FIELDS Returning ...
4
votes
0answers
37 views

Any way of returning a constant (ideally null) from a SOQL “group by”?

I have some code that does a series of "group by" queries, and uses a common method (apply) to process the results: for (AggregateResult ar : [ select PaymentSpecification__c id, Status__c ...
2
votes
1answer
39 views

Queries containing special characters

We have a number of users who will write their case notes in Word, then paste them into Salesforce. We have now implemented a custom search on case notes (and a few other fields) and have found a ...
2
votes
2answers
58 views

Javascript SOQL Query in a Button

I am trying to runa query in a .js button to pull out an ID of a contact that is associated with a record so I can auto send an EchoSign document. However I can not get this working, my googling ...
3
votes
1answer
48 views

With junction object - how to merge these 2 queries?

I have a junction object of Oppty and Custom-Object-license Opportunity -- LicenseOfOpportunityJunction -- License I am trying to get a certain field from License (license.dongle_name) from a ...
2
votes
1answer
24 views

Query on permission sets held by a user

Does anyone know a basic way that I can run a SOQL query to see which permission sets are attached to users? We have a rather large issue where a button needs to be on a page layout for a few ...
0
votes
0answers
28 views

Querying Email-To-Case Routing Address

Is there a way to query the Routing Addresses for Email-to-Case? I've found the EmailServicesAddress object but that only seems to give me the address generated by SF. I'd like a way to actually ...
1
vote
1answer
23 views

Using SOQL with ExactTarget, how to I access the “System Data View”?

Trying to fetch subscriber data from a specific list from ExactTarget. When querying the "System Data View", an error is returned saying "System Data View cannot be accessed" - which might be ...
1
vote
1answer
25 views

What is the best way to add to an apex collection of String

Is there a more efficient way to Select data into a String collection e.g. Set<String> than using a for loop Set<String> allTopicSet = new Set<String>(); for (Topic t: [select ...
0
votes
1answer
30 views

SOQL for Multi-select picklist in where clause having a variable

How about this below I called this class method from a trigger providing a string value to it, which is same as User's service segment field ( a multi select picklist). but I am getting an error in ...
0
votes
1answer
24 views

Parent Role Name of Current User in SOQL

Below query is giving me an error.What is the best way to get the Parent Role Name of current user. list<UserRole> uRole = [Select u.ParentRoleId,u.ParentRoleId.Name, u.Name, u.Id From ...
1
vote
2answers
99 views

Rollup Summary Trigger when I change the parent record

Hi this is my trigger for Rollup summary. No problem it is working how i wanted it to be but the problem is when i change the parent name it is not updating the field value in new parent record Kindly ...
2
votes
1answer
28 views

Can you filter a list from a SOQL query in apex doing something like LINQ in .NET

I am doing a SOQL query and return all cases similar to this: List cases = [Select Id, Name, State from Case]; I have 4 repeaters in a visualforce page and I want to bind each repeater to a subset ...
3
votes
1answer
24 views

Relationship Query to Get All Events Associated with Account

I have the following query that works for getting all the Tasks and Events for a Lead. [SELECT ID, activity_count__c, (SELECT ID FROM Tasks WHERE Status = 'Completed'), (SELECT ID FROM Events) FROM ...
1
vote
1answer
31 views

Using custom setting variable directly in a SOQL statement (System.QueryException: No such column xx entity)

I want to use custom setting in direct soql statement, but it turns out not working. Because of the requirement, I can't add another field in that object. The only thing I can do is to use Custom ...
2
votes
2answers
49 views

Help with Field Formula

Not sure if this is entirely possible. I have been asked to create a checkbox field on the Account object. Below is the SOQL query that would list all accounts that have Opportunities that are 'Closed ...
-4
votes
0answers
29 views

unable to write a soql query in debug

I have 10,000+ records and need only 500 records. I need to separate 500 records from rest of them and want to disable other records. I don't know ID's but I know the "names" of the 500 records. ...
0
votes
2answers
82 views

How to get picklist input field value in Controller?

I have an object with a picklist including two values "status" (Valid,Invalid).. I'm using search in my VF page dependent on the selected status from this picklist, so the SOQL should return the ...
1
vote
1answer
48 views

Checking syntax of SFRestRequest

I am unable to get a response back ("didloadresponse" doesn't fire) from SFRestRequest and I am not sure why. Is the syntax of _queryParams correct?
0
votes
1answer
59 views

Why does this SOQL statement return no results?

The line inside the loop in the following code is reported as having no test coverage. This is corroborated by other code that uses the set not having test coverage either. Previously I was not using ...
1
vote
3answers
49 views

How to sort the values inPageblockTable vf page?

In vf page i have created look up field (look up to custom object "PO") and created a "Add" custom button. When the user click on the show button all the Serial record names are displayed in Page ...
0
votes
1answer
31 views

soql query for soap webservice

actually in sfdc quote i have fields quantity,price if i change the price,qunatity i want to reterview the records, id's of quotes which was quantity,price was changed may i know how can i write the ...
1
vote
1answer
13 views

Not getting Lead Class inside PartnerWSDL

I am integrating Sales force in ASP.NET application so here I am using PartnerWSDL for integration but when I quering SOQL language for Lead then how can I retrieve the data from that because I am ...
2
votes
1answer
55 views

Aggregate SOQL with more than one 'group by'

I am using an aggregate SOQL query with more than one 'group by' I'm writing a class that fires on insert/update of a trigger on the OpportunityLineItem. This looks at a picklist field (Play__c) on ...
2
votes
0answers
40 views

Is there a simple way to generate a create table script from a salesforce class?

I am looking for a way to synchronize Salesforce data with a local database. At the moment I just want a pain free way of downloading the data. I've been playing around with importing CSVs from the ...
2
votes
1answer
30 views

How to reduce the Select Apex calls in a multi level situation like this?

I want to reduce the Apex calls in the following situation: For every account, I have a string ID, that is the ID of the Bill_to_account for that account (kind of financial hierarchy) (NOT Hierarchy ...
4
votes
2answers
37 views

Query to Identify all records owned by a User

Is there any query which ca n retrieve all the records owned by a user. We have a request to transfer all the records owned by User A to User B. We have lot of custom objects, so i was wondering if ...
-2
votes
2answers
38 views

How to write the Query in batch class

is this correct query or not. this is batch class query but i did't get the values any one can tell me Query: 'SELECT Id,RRD_No__c,Exist_in_Abacus__c,Status__c FROM Demand__c WHERE ...
1
vote
2answers
46 views

how to write the soql query with day in month and calender month date functions?

I want to write below query for current month and day in month... I tried like this way but facing error... Like...system.today:unexpected token SELECT Name, Amount__c,Start_Date__c From Account a ...
4
votes
2answers
35 views

Data skew error over 100k records for a managed packaged object

I know Data skew errors for Non-selective queries executed on custom field filters that are not marked as External throw this error, i.e. we cannot run SOQL on an object which has more than 100k ...
0
votes
1answer
63 views

Using Date in SOQL to get only records created on a certain date

I'm using this soql query in my webservice to query for records created within specific dates and using this as an if condition of the dates are the same if(fromDate == toDate){ orderList = ...