A Salesforce-specific query language, modeled on SQL, for accessing information saved in the Salesforce database.
0
votes
1answer
23 views
Trigger Testing Question
I've written a simple trigger that updates a field on child Contact records when a specific field in the parent Account record is modified. When I test it manually, it works beautifully!
However, I'm ...
1
vote
3answers
28 views
Query records with their parent record name and their related records
I'm trying to query records with their parent record name and their related records.
This is my query:
SELECT Id, Name, Record_Type_Name__c,
Engagement_Model__r.Name, (SELECT ...
3
votes
0answers
25 views
Returning an Auto-Increment value
I'm just curious, is there a method to access an auto-increment number in a newly inserted record without making another SOQL call? Something similar to how MySQL can call up the last insert ID after ...
2
votes
3answers
55 views
Map of API name and value pair..?
I want to create a map of apiname and value pair..please help...
i want record value...like if apiname of opportunity field is name..then i want record value..ie opportunity name...
for eg
...
1
vote
1answer
18 views
unable to query Case object
when trying to query case object with below SOQL, giving me an error that no such field exist. where as i can able to see field in the customization. ? is this permission issue ?
select id,status ...
3
votes
1answer
27 views
Understanding Results of Querying ContentWorkspace
How is access or readabiity of a ContentWorkspace (library) determined? The following query is returning different results for me:
select id, name from ContentWorkspace
When logged in as a System ...
2
votes
2answers
32 views
Get Opportunity's Account
Question
Why I can't access to opportunity account name on apex/vf ?
Backgound
I'm creating a opportunity VF page, extending the standarcontroller:
<apex:page standardController="Opportunity" ...
1
vote
1answer
29 views
Use COUNT_DISTINCT(field) on REST SOQL API query
I'm currently trying to run the following SOQL query using the REST API:
SELECT Id, accountId, COUNT_DISTINCT(accountId)
FROM Contact
WHERE Phone LIKE '%" + CLI + "'
OR HomePhone LIKE '%" + CLI ...
0
votes
1answer
19 views
SOQL with OpportunityContactRole
I am trying to get all the role from OpportunityContactRole into a list my code
OppContactRole = new List<OpportunityContactRole>();
OppContactRole = [SELECT Role FROM OpportunityContactRole];
...
3
votes
1answer
27 views
Outbound Messaging: ActionId
I'm investigating the use of Outbound messaging for some integrations we need to make with SalesForce.
According to the documentation, the outbound message includes an ActionId field which is a ...
3
votes
1answer
75 views
How to implement a generic DAO object for Service pattern with Apex?
Considering advice given for DAO objects or Service pattern from What is a good set of coding conventions for Salesforce development?, I'm wondering how can they be made generic enough?
Some generic ...
4
votes
2answers
42 views
How does SOQL consider INCLUDES for multipicklist? AND or OR
i have multipicklist for industry.
I have a records which has Bank,agriculture as the selected values.
If i need to get all the records have bank and agriculture selected together. Would includes ...
5
votes
1answer
46 views
Can you use SOQL Date Literals in Apex?
Date Literals are really helpful in SOQL queries. There are times in Apex where it would be really helpful to be able to use the literals or some sort of easy equivalent (not in a SOQL query). Is ...
1
vote
1answer
44 views
query user and profile
I'm fairly new to salesforce so please bare with me as my understanding of the API' and SOQL is very limited.
I'm having troubles linking user object and profile object through 1 query(), the correct ...
2
votes
2answers
58 views
Determine sobject Type From Id Using SOAP API
I'm using C# and would like to determine the type of an sObject based on it's id.
I would like to pass an id to my app and have it return a list of accounts related to it. I need to identify the ...
0
votes
1answer
32 views
Need to find all TextAreas that have an unsual character
I have a long text area field which in some cases has characters that cause problems e.g. Vertical Tabs. I need to find all instances where the field contains such a character I can't write a SOQL ...
1
vote
2answers
51 views
SOQL query for text in the middle of text
Usually in SQL when you do a search on the lines of
... where blah like 'tony%'
You can index blah column and then get a B Tree search.
When you search for
'%tony'
You don't get a B tree ...
2
votes
3answers
83 views
What does the 'lkid' URL parameter mean?
What exactly is CF00NW0000000diSH_lkid a reference to, in this case?
portfoliofunction = [
SELECT Id, Name, Subsidiaries_On_Contract__c
FROM Contract_Overview__c
WHERE ...
4
votes
2answers
63 views
How to export more than 50K records matching a query as a CSV?
I'm building a CSV exporter for use within a Customer Portal that allows them to export in bulk some of their data (basically usage logs, which there are a ton of). For some super users there are ...
2
votes
2answers
53 views
Avoiding casting with dynamic SOQL
According to this http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_dynamic_soql.htm
I should be able to avoid casting using dyanmic soql
However when I try:
opportunity = 'select ...
0
votes
1answer
32 views
Can I use a text field to create an Account object in a trigger?
I am adding an after insert trigger on lead, where if there is a value (id) in a custom field (fromAccount__c), that specific account with said id, will be deleted.
this is in order to solve How to ...
2
votes
3answers
140 views
How to run SOQL for an Object having more than 100K records?
set<ID> conIDs = new set<Id>();
for (Time__c t : trigger.new)
{
if (t.Contact__c != null)
conIDs.add(t.Contact__c);
}
if (!conIDs.isEmpty())
{
for(Time__c t : [Select Id, ...
3
votes
2answers
47 views
Error: Field must be grouped or aggregated
We have a lookup relationship between a custom object Problem__c and cases, one problem can be related to many cases. I am trying to query the field or problem records and the number of related cases, ...
4
votes
2answers
56 views
Determine character length of formula fields prior to dynamic SOQL
My application constructs dynamic SOQL queries based on user interaction. The query can get quite large so I split the query into multiple queries based on the character count.
However, formula ...
3
votes
1answer
35 views
where in syntax
I am looking for the where in syntax for raw soql.
I try:
SELECT ID, OWNDERID FROM Opportunity where OwnerID in {'005G0000002eMbxIAE'};
and
SELECT ID, OWNDERID FROM Opportunity where OwnerID in ...
2
votes
2answers
54 views
Get Accounts with at least one attached object via SOQL
We have an object that relates to Account (Services). I'm trying to write a SOQL query that can give me accounts that have at least one active such object. Those objects have a checkbox that is ...
-1
votes
1answer
54 views
@future to reduce number of Soql Queries
Say Suppose I'm having 150 Records in a Custom object and I will display 100 records in a Vf page.When I select all the records and process then what happens is based on criteria,these fields will ...
6
votes
2answers
94 views
how to compare time only from Datetime field in SOQL
I have a custom Object which contains a Datetime field let say bookingDate
It contains date and time of booking.
now i need to get all bookings starts from 2:00 PM to 4:00 PM regardless of date ...
2
votes
2answers
87 views
Problem with EntitySubscription query and getting a Non-selective query exception
I have the following apex code that runs to get the EntitySubscriptions for a set of ids so they can be deleted to clean up the chatter feed.
public static List<EntitySubscription> ...
2
votes
1answer
51 views
SOQL Query in Batch Apex start() times out even with multiple filter statements
In my SOQL query in my Apex Batch start() methods I query and order
SELECT TextField__c
FROM MasterDetailChildWith4MillionRecords__c
WHERE Active__c = 'Yes'
AND Revenue__c != 0
AND Lookup__c = ...
0
votes
1answer
62 views
Too many SOQL queries: 101 in apex class. How to count results?
List<tempcon1> listoftemp;
CheckContactController chk = new CheckContactController();
public List<tempcon1> getconValues() {
listoftemp = new List<tempcon1>();
for ...
3
votes
1answer
28 views
How can I filter activities by record type?
Issue
How can I filter the ActivityHistories sub-query by record type? When I use record type in the query it's saying the field isn't valid.
Background
I'm doing a custom last activity date for a ...
0
votes
0answers
22 views
SOQL Selecting CollaborationGroups, GroupMembers and Posts/Comments?
Hey guys I'm trying to take a member, and select the group(s) the belong to, the (other) members in that group, and all posts and comments that are in that group. I have it set right now where I am ...
4
votes
2answers
47 views
Why are the results returned using a subquery different than when querying Tasks directly?
I am running the code below in a Task trigger. The subquery on Account returns 0 rows, but the direct Task query returns 1 row; there should be 1 row. Can someone explain why this could be ...
0
votes
1answer
173 views
Getting started on Apex - populate lookup field via SoQL
I am looking to use an Apex Class in a Visualforce page that populates a field based on the result of a SoQL query.
The idea is that I am making a custom Save And Do X button which must be available ...
1
vote
2answers
61 views
SOQL Filter By First Letter
I have recently inherited a Visualforce page that lists all Accounts in a dropdown. As the company has grown, so has the list of accounts.
Now that the account list has more than 1,000 entries and ...
1
vote
0answers
38 views
Error [sforce-2900000]: INVALID_FIELD: Can select only RecordId, a Has*Access field, and MaxAccessLevel
Running the below query returns and error message
"Error [sforce-2900000]: INVALID_FIELD: Can select only RecordId, a Has*Access field, and MaxAccessLevel"
SELECT
RecordId,
HasReadAccess,
...
7
votes
5answers
89 views
Trying to LIMIT a SOQL Statement based upon projected Heap size
THE GOAL: Return as many rows as possible from a Remote method without hitting Heap limits.
We have a Visualforce page calling into a @RemoteAction method in Apex to return sObjects to the page. The ...
2
votes
2answers
39 views
SOQL to get attachment(s) on PollPost
Just curious what SOQL I would use to get the Poll Items
(attachments) on a FeetItem with the Type PollPost?
So if we had a poll saying, "Whats your favourite color?"
How would I get the line item ...
2
votes
1answer
47 views
Retrieving Notes and Attachments related to a custom object in a single SOQL query
I want to retrieve Notes And Attachments that are attached with the record of a custom object in a single query .How can i do this?
SELECT Id,Name,(SELECT Id,Title FROM Notes),(SELECT Id,Name FROM ...
1
vote
1answer
50 views
Subtotal vs Aggregate Function
I have created a custom object Commission_Rec__c with a master/detail relationship with a custom child object of Order_Entry__c. What I am trying to do is create a vfpage the will display information ...
2
votes
1answer
43 views
Malformed Query, failure to recognize Relationship; Cannot Sub-Select
hey guys my query for some reason is failing to understand the relationship here, though I'm being pretty explicit in my subselect. I've tried all three of the following and received three different ...
0
votes
1answer
23 views
SOAP Equivelant of RESTs /chatter/users/me/conversations?
Title pretty much says it, I know that in REST we query private conversations using the above endpoint /chatter/users/{ID}/conversations, but I'm not sure where to look for the same thing in SOAP. ...
3
votes
2answers
26 views
Combining 2 resultset of “Find” in soql
Can we combine 2 resultset of "Find" statement. I have one field that I am searching on NAME and other fields which I am searching on ALL columns...Although my RETRIEVAL columns are same...
Please ...
1
vote
1answer
41 views
SOQL Selecting Chatter comments if been created or has been replied to in the last 24 hours
Hey guys I've been experimenting with different queries to try and get all Chatter Posts and their comments within the last 24hr period, but realize that doing this without Apex Triggers is much more ...
6
votes
2answers
70 views
SOQL Statement to get “Who commented on which author's post?”
I am trying to get a simple list of who in chatter commented on which authors post and I am struggling to get a correct SOQL. I want something like this
Bob -> Dave
Dave -> Martha
Bruce -> ...
2
votes
2answers
64 views
SOQL query help using specific combinations of two variables that also appear in another object
I have two different custom objects. Each object is related to both an Account and a Campaign via a lookup field. So both objects have the following fields:
sObject.Account__c
sObject.Campaign__c
...
2
votes
2answers
63 views
Using a field inside the same record in a SOQL's WHERE clause
Let's say I have my Account object containing a custom Asset__c lookup field. I'm looking for a way to make an SOQL request similar to this one:
SELECT
Id,
AccountId,
Account.Asset__r.Id
...
3
votes
3answers
121 views
Update custom object after insert trigger
I have created a trigger for a custom object for the event "After Insert" only. When running the test for this trigger the test fails with the following error:
System.DmlException: Insert failed. ...
2
votes
1answer
79 views
Can we query the info from “Data Management -> Storage Usage” through SOAP API?
Can we query the info from "Data Management -> Storage Usage" through SOAP API? If so how?
Actually, I need the count of records in all the objects in the org, and the size. (Also would like to know ...


