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

learn more… | top users | synonyms

0
votes
1answer
14 views

Getting current contact record in Apex class

I am working in the Service Console. I have a VF page displayed as a component in the right side panel. I want to display all contacts related to the current contact based on a particular custom field ...
0
votes
1answer
9 views

How to create opportunity Using Connected App Callback URL

I have used bellow URL to get opportunity list using SOQL Query in .net Web application : token.instance_url +"/services/data/v33.0/query?q=SELECT+Id,Name+FROM+Opportunity" In SQL Query we can write ...
3
votes
4answers
127 views

Salesforce large query conditions: query 20000 contacts by emails and update fields

I have a csv file which has 20000 email addresses in it. I need to update some fields on these contacts. the dataloader is not suitable as I don't have the ID field of these email addresses. query in ...
1
vote
1answer
16 views

Add an already existing record to a related list - Continued

I am very new to visualforce and I was trying to create a page like the one described here: Add an already existing record to a related list In my case though, I want to be able to add a custom ...
1
vote
1answer
20 views

How do you reference the list of detail records in a trigger

i have an MDR, and in the trigger on the master, and I'm trying to access the children. how do you do that? The detail is named pg_metric__c. I'm referencing it as c.PG_Metrics__r
1
vote
2answers
21 views

Error: System.QueryException: Non-selective query

I get this error.. System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if ...
0
votes
0answers
18 views

Populating listbox from SOQL query

Im trying to to create this loop to return more than one ID, name, Role. I want this loop to return ALL active users and then i want it to be DISPALYED into my listbox. Can someone help me or fix my ...
0
votes
1answer
22 views

SOQL: Select Opportunity based on Product fields

I am trying to query Opportunities which have a Product matching certain criteria on, something like below: SELECT Name FROM Opportunity WHERE type != 'renewal' AND Id IN (SELECT OpportunityId ...
0
votes
1answer
30 views

Can “GROUP BY” be used in a relationship query

Can any one let me know if "GROUP BY" can be used in a relationship query. In the given Query, I'm using "GROUP BY" to identify the same product name in a relationship. SELECT gmod__product__r.name, ...
2
votes
2answers
38 views

SOQL Fails only in Apex Trigger

I am trying to query a list of objects using a value from the account object being inserted. When the query executes it is returning a row count of 0. However, if I run this same query using the ...
0
votes
3answers
40 views

Need help in improving SOQL performance

I have a SOQL query as below (where clause only). This query is not performing upto the mark, may be because of like operator. How can I substitute this :- Where ( abc__c = 'chris' OR xyz__c = ...
0
votes
1answer
30 views

Soql not queried the requested field error but i am querying the field

Class: public void PNSearch(){ //varible declarations parentId=Apexpages.currentPage().getParameters().get('id'); //Query to retrieve all Quote line Items which are childs to current ...
0
votes
1answer
25 views

soql on events, to display all the events regardless of who is assigned to in a VF page within a community

I am not sure if I am approaching my problem the right way, maybe not, so I will give a very brief explanation of what I am trying to achieve: Currently I have 2 communities, Community 1 is focused ...
0
votes
1answer
21 views

Question on CreatedDate Value and Multiple User Tasks

I'm using the Task's multiple users function but copies of the same task records are created when I create a task. So I'm thinking of creating a trigger to synchronize these tasks. My criteria to ...
4
votes
1answer
69 views

How to use dynamic SOQL to instantiate a MAP

I've tried doing it, but I get this error: Compile error at line 101 column 32 Invalid initial type List<SObject> for Map<Id,Opportunity> Here's my code: //build out the set set ...
1
vote
3answers
39 views

Exporting entire database via API

We use the salesforce dataloader to do occasional exports of our entire database so we can use our local database tools to run analysis and data cleaning that we can't manage via reporting and ...
0
votes
2answers
22 views

Relationship queries (parent-child)

I am new to Salesforce and I am struggling to get my head around the correct SOQL which correctly reference multiple tables. Some background: I have a custom field in Order Product called Teacher_c ...
0
votes
1answer
29 views

Querying against a multi-select picklist

I'm trying to run a SOQL query that pulls campaigns where the value of a custom picklist field (Newsletter_Subscriptions__c) is included in a Contacts multi-select picklist fields ...
2
votes
1answer
29 views

How to query Leads that have 1+ attachments?

Here's my query to get leads with attachments: select id, name, (select id, name from attachments) from Lead where id in ( select parentId from attachment) However I get an error saying that "the ...
0
votes
3answers
37 views

Getting fridays data with in the year

In my project there is a field called STUDENT, and object is Joining Date. So how i can access "who joining on Fridays in last year" by using Sales-force Object Query Language.
0
votes
2answers
55 views

Select AccountId from Order

I'm new to Salesforce and SOQL but not PHP and SQL, therefore this question is a little odd to myself that I can't figure it out. The Enterprise SOQL query runs fine and presents the desired results ...
0
votes
1answer
38 views

How to SOQL more than one object in a batch class

How to query more than one object in a batch class? Is it possible please let me a example code for it.
0
votes
2answers
21 views

query to determine if someone has voted on an idea

I'm using the standard idea object to post ideas and have users promote/demote ideas. How can you query an idea record to determine if a user has voted on the idea? Thanks for any help.
0
votes
2answers
49 views

Fire Trigger Only When Stages Moves to Closed Won

I have the trigger class below and I would like it to fire only when an Opportunity Stage is changed to Closed Won. Can anyone help me figure out how to do this? I have an if statement, but it fires ...
0
votes
1answer
18 views

How can I make my SOQL query of Contacts filtered by AccountID more selective?

I am building a trigger on the Account object to calculate various task rollups (Completed Calls, Completed Emails, Open Tasks, etc..), and I am trying to make it also account for tasks that are ...
0
votes
0answers
23 views

Limits on Salesforce Excel connector data

I have configured sforce_connect.xla add-in in excel to fetch data from salesforce to excel sheet. Now for query results I am getting maximum 790 records where it should be 1000 or more as I can ...
1
vote
1answer
45 views

SOQL Can't create USERS relationship?

I think what I'm trying to do is pretty simple. I simply want a list of accounts, but have information like the account owner displayed. I know the ACCOUNT table has "OwnerID", which joins with "ID" ...
0
votes
1answer
28 views

SOQL Code error

Could someone, please, help with this. Below is my field label, name and data type: Field Label Field name Data Type Owner Owner Lookup(User,Queue) I wrote ...
0
votes
0answers
18 views

ERROR AS :duplicate alias name in developer console (Group BY)

Why do i get this ERROR as :duplicate alias name in developer console. When i use the Soql Query as : SELECT gmod__product__r.name, gmod__opportunity__c, SUM(gmod__Amount__c) gmod__Amount__c, ...
2
votes
2answers
91 views

apex: query from a list

I'm using apex and salesforce stuff. I have a list of some accounts and now I need to create another list of the accounts that are valid. so imagine this is the list: List<Account__c> ...
3
votes
1answer
49 views

Using SOQL, how can I tell which dashboards have not been used in the past year?

The title says it all, really - I am looking at hundreds of dashboards (literally) and I want to find the ones that aren't being used and kill them. Any thoughts? Thanks!
1
vote
3answers
43 views

Change Sets and too many SOQL statements

I'm at a point where I'm bumping up to a ceiling in the number of SOQL statements during deployment of inbound change sets - I have several VF pages, page controllers, triggers and test classes, and ...
2
votes
2answers
35 views

Using SOQL, how can I access the LastTransferDate on the Lead object?

Whenever I try using a reasonable query: SELECT Id, Name, LastTransferDate, LastActivityDate, LastModifiedDate, CreatedDate, IsUnreadByOwner, OwnerId, Owner.Name FROM Lead I get this ...
3
votes
1answer
197 views

Problem in loop

I have this request: for loop that retrieve 10 object from Acccount and their childs and for each account display the Account and its related childrens Here is my sample code: for (Account acc : ...
0
votes
0answers
7 views

Can't see all users' ContentVersion rows in Workbench

Following query is useful to me, to see which files have been uploaded to Salesforce. This query only shows rows that have actually been created by the user who is logged into workbench and running ...
2
votes
1answer
78 views

List.add( value || 'default value')?

After querying for Account sObjects, I'm adding all the fields into a List. The problem is that some Account sObjects have certain fields and others do not. While adding the fields to my list, I'd ...
0
votes
1answer
28 views

Multiple LIKE in SOQL

I have a batch class where I need to find all contacts with titles like director, cEO, etc. This should allow partial matches such as 'support director', 'sales director', I was trying this but is not ...
5
votes
1answer
126 views

SOQL: How to handle relationship query with more than 50,000 results

ISSUE: I have a SOQL of that returns a reasonable amount of rows of Campaign based on Contact Ids (i.e. 200 batch of contacts maybe 1000 connected Campaigns) But it also returns an relationship query ...
0
votes
1answer
27 views

Sorting functionality using dynamic soql

I have created a visual force page in Account page that displays related opportunities by RecordType(5 Records at a time) for the given Account and when click on Go to List it directs to new VF page ...
1
vote
1answer
49 views

SOQL: Bulk Fuzzy Searching

I have a list of accounts that I would like to perform a LIKE query on. Ideally, my query would be something like: SELECT id, owner.name FROM Account WHERE name LIKE IN :entityList Is there any way ...
2
votes
0answers
20 views

Effective way of searching for Account based on a set of attributes received from third party system?

I'm gonna try to keep this question from not being a discussion subject, as well as I can. The scenario I'm facing is that I have a system with multiple third party integrations which requests data ...
1
vote
2answers
86 views

How to Get the Current System Time using SOQL

For tests proposes, I need to get the current system date. On Oracle we could use: SELECT SYSDATE FROM DUAL On SQL SERVER, we can use: SELECT GETDATE() AS CurrentDateTime How to query the ...
8
votes
1answer
80 views

What does Limits.getAggregateQueries() represent?

Per the Limits class documentation, there are a pair of methods for "aggregate queries": getAggregateQueries() Returns the number of aggregate queries that have been processed with any SOQL ...
2
votes
3answers
37 views

sObject type 'Partner' is not supported

I have a Update trigger on Opportunity. The trigger queries the Partner object. [Select AccountToID from Partner where OpportunityID IN: Trigger.newmap.keyset()] The above trigger has been running ...
0
votes
1answer
27 views

Variable does not exist in relationship SOQL

I tried the following SOQL and tried to use the ProductCode but getting the error as given below. for(PriceBookEntry pbe: [Select p.UseStandardPrice, p.UnitPrice, p.ProductCode, p.Product2Id, ...
0
votes
1answer
11 views

Date range on custom date field in SOQL Query

Is there a limitation that prevent filtering SOQL queries on custom date fields? This query works; SELECT Id FROM SomeObject__c WHERE CreatedDate >= 2012-12-27T00:00:00Z This one; SELECT Id ...
0
votes
1answer
12 views

Query and display aggregate list

I have an aggregated list that counts the number of records from a custom object created by a user that I display on a visualforce page. I need to also display the same thing from a different custom ...
0
votes
0answers
40 views

Nested SOQL Query in a Flow

I'm having a hard time designing a flow according to Salesforce best practices, which is of course essentially to limit the number of times you have to interact with the database. So where I'm having ...
3
votes
2answers
107 views

How do I access Custom Settings in Apex?

If I have a hierarchical custom setting: Custom_Page__c With one field: Url__c Using apex, how can I surface this field in a visualforce page? Can I just query it as if I was querying a custom ...
0
votes
1answer
26 views

Help with simple SOQL relationship queries that I cant get to work

Trying to understand relationship queries. Could you please review the quesries that wont work below and comment on what I am doing incorrectly? I have 2 objects: Festivals__c (Parent Object to ...