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
13 views

multiple checkbox error

i am having multiple checkbox according to selected checkbox query have to perform search operation. public class actionSupportController { public List<PCS_Household__c> lstQuery{get;set;} ...
1
vote
2answers
21 views

Bulkify SOQL-Query in Trigger to search for duplicate objects

My trigger fires on my CustomObject ProductionOrganizer__c and searches leads with the same E-Mail or same LastName && Company (The object therefore has a field for email, lastname and ...
0
votes
2answers
21 views

Getting an error with select query for Mulitple Checkbox

i want select query for multiple checkbox but I am getting an error System.QueryException: unexpected token: 'true' Error is in expression '{!dochar}' in component in page cc: ...
0
votes
2answers
128 views

how to solve database Problem?

Decimal zipCode = [SELECT zipcode__c FROM student__c ORDER BY zipcode__c DESC LIMIT 1 ].zipcode__c; What the Meaning of this line..
0
votes
1answer
29 views

select query for multiple checkboxes?

VF Page <apex:page Controller="actionSupportController"> <apex:form > <apex:pageBlock > Household Name: <apex:inputText value="{!ID_c}"/> ...
0
votes
0answers
14 views

View which fields are used on which record types?

Is there a way, hopefully via SOQL, to view which fields are used on which Record Types? Essentially we use a lot of Record Types and a lot of custom fields and I'd like to review what is used where. ...
1
vote
1answer
23 views

Soql from child to parent

I have custom junction object which has Master-detail relation ship with contact. Generally we have relation ship field that contain contact name in junction object.but I want write soql query to ...
0
votes
1answer
37 views

reference the owner first name in sObject

How can I reference the owner first name from an sObject in Apex? Below I'm trying to concatenate the date and Owner name fields from an sObject wdCreate.Name = ...
2
votes
1answer
56 views

Unable to add PriceBookEntry with APEX

i want to add product price into PricebookEntry object with help of following APEX code: PricebookEntry pBook = new PricebookEntry(UnitPrice = price, ...
0
votes
0answers
31 views

Class produces same result everyday using SOQL Today() function

I have a class that implements Schedulable...pulls in a list of records created today, by using the TODAY() function. The data should change, and when the SOQL query is run manually, I do get ...
2
votes
1answer
34 views

Difference between Owner.Id vs OwnerId

Trying to write some test code for a custom object and its controller class. I noticed that one of my methods which depends on the ownership of an object was bugging out and I discovered that Owner.Id ...
1
vote
1answer
15 views

RecordTypeId in Account - there is one on an account that is not in the list in the UI

We have a client who's website we integrated with their Salesforce account. In order to login to their website, the website CMS user's email address has to match a contact in a valid Organization ...
1
vote
1answer
18 views

Query Object Access by Profile

I have looked at the documentation and it seems the best I can do is query ObjectPermissions for PermissionSet access. Is it possible to do the same for Profile instead of PermissionSet? THANKS FOR ...
1
vote
1answer
57 views

SOQL:How to query the Upserted data that has been modified or inserted in every one hour [closed]

We have to verify Data for Upserted action in sandbox. We have scheduled job Using data migration tool which is running hourly basis. and basically Outputting the data in SFDC target. we tried ...
2
votes
1answer
31 views

SOQL query all private report “USING SCOPE allPrivate” not working in some environements

The following query is not working as mentioned in document, getting exception [object Object]: Invalid query scope: allPrivate SELECT Id FROM Report USING SCOPE allPrivate WHERE LastRunDate < ...
4
votes
1answer
37 views

How to capture the nested fields on a lead object?

I am using .NET toolkit for integration with salesforce.com One of the queries I have is Select Id, Name, ConvertedOpportunityId, ConvertedOpportunity.Amount , ConvertedOpportunity.Name, ...
0
votes
2answers
29 views

How to combine two SOQL query into one

Instead of writing two separate query and execute two separate time, I'm thinking if I can combine into one. Here is my first query: SELECT Has_Attachment__c,Id,Name, profile__c FROM profile__c ...
1
vote
1answer
17 views

Test class not picking up contact at account related to opp

I have an opportunity class ext that has: List<Contact> relatedContacts = [SELECT Id, account.id, firstName, lastName, email, Title, account.name, ...
4
votes
3answers
69 views

Aggregate Values with Limits and Orders

Basically, what I am looking to accoplish with the SOQL Query, is to return the average value of the Last N (20) SAT scores from the Case object. The query would essentially look like this: Select ...
4
votes
1answer
41 views

using apex to identify fields in a query that spans multiple objects

I have a query like the following (sample) where the query is pulling fields from multiple objects. list<contact> cons = [select id, lastName, account.name, account.custom_field__c from ...
0
votes
0answers
44 views

How to get owner name from of accounts & opportunities

Hi friends i'm new to development i got a requirement like to get account owner names and opportunities owner names from cases.So i tried to write a soql query to get for specific record type in ...
0
votes
0answers
18 views

Scenario to get all article type results [closed]

I am trying to get results in Apex from all possible article types in my org. So that I can combine them and display articles from all article types. Now I am not able to use SOSL here as I do not ...
-2
votes
0answers
24 views

Query fail in apex code works fine on Developer console [closed]

I need to understand the reason and scenario that why a query fails in an apex But runs fine on the developer console. after indexing all is working fine. Query : SELECT ...
4
votes
2answers
92 views

Subquery limit handling

Can someone help me in the below scenario. Scenario: I have a list of account id's. In that list of id's i want to separate the list of id's which have contacts associated to an account and the list ...
1
vote
2answers
31 views

How to save bulk data with some conditiond

i want to save following JSON data to "myObject__c". suppose i have already "test1@gmail.com" and "test3@gmail.com" in my salesforce object. So how can i save following data in "myObject__c" except ...
0
votes
0answers
29 views

How to use multiple NOT LIKE

Please Help!! How to use Multiple not like conditions select name,Label__c,Populated_On__c,Populated_On_per__c,Type__c from Field_Analysis__c where not Label__c like '%FONT%' OR Label__c like ...
3
votes
1answer
32 views

How to filter formula fields in SOQL or APEX

Please Help!!! I would like to retrieve all the fields except formula
2
votes
1answer
24 views

How to Query for dupe leads in Bulk with Mapping?

Goal: 'Bulkify' the existing Apex trigger used for counting how many dupes a Lead had, and inserting the Contact Id of the Contact record (if more than one, the first in the list) that matched the ...
2
votes
2answers
39 views

How to match mobile phone numbers for incoming SMS messages?

I'm looking at receiving SMS (text) messages in Salesforce and the formatting of the "From" mobile phone number (in a Twilio Webhook call) is: +35386xxxxxxx (where 353 is the country code in this ...
0
votes
2answers
27 views

Apex AggregateResult show Distinct Values only

I am searching for the equivalent of a SOQL DISTINCT to use within my AggregateResult query below. I would like to group my results using a field called "Servicer_Code__c". Would any one know if ...
1
vote
2answers
44 views

Adding Date criterion in WHERE Clause

Here I am doing an aggregate SOQL List<AggregateResult> ListName = [select SUM(Field1__c), SUM(Field2__c), from CustomObject__c where ...
2
votes
2answers
31 views

test class fails system.assert but manual upload performs as expected

I don't understand why when i upload the two invoices in my test class through the data wizard they perform as expected based on the triggers I've written. but when i run this test class it fails due ...
-3
votes
1answer
24 views

Way to see trigger using email template without going through CODE [closed]

If there is a way for me to easily see if any apex triggers are using email templates without looking through the code?
0
votes
2answers
36 views

Get max(field) from List of sObject in salesforce

I have List of Records for which I want to find out Maximum value for particular Field: Can anyone suggest me, any efficient way (rather than writing Sorting Method) Example : public decimal ...
1
vote
1answer
53 views

Amend a SOQL query

I'm trying to amend my code to change one of the fields that appears in an email. I no longer wish for the BMCServiceDesk__IncidentResolution__c field to appear in an email. I understand how I could ...
0
votes
3answers
28 views

Only variable references are allowed in dynamic SOQL/SOSL

I'm trying to re-request an Asset from the database: asset = Database.query('SELECT ID, Price, Asset_MRR__c FROM Asset WHERE id =: ' + asset.id + ' limit 1'); But I get an error: Only variable ...
2
votes
1answer
30 views

Compare trigger record to aggregate list

A few things wrong with this query.. Error: Compile Error: Illegal assignment from List<AggregateResult> to List<Recurly_Invoice__c> at line 3 column 30 and what i really want to ...
0
votes
0answers
26 views

No updates occurred after successful trigger fired

Not sure why nothing is happening. I'm just testing for now as I build this out, but for my test i was trying to make all invoices First_Invoice_del__c field equal to true when one is updated. I ...
0
votes
0answers
18 views

given one child record, SOQL for all child records of same record type with same parent

I'm trying to run a trigger on Recurly_Invoice__c which is a child of Account. I'm testing part of the SOQL and keep getting this error: Bind variables only allowed in apex code. The inner select ...
0
votes
1answer
31 views

Retrieve Cases with CaseHistories in One Query

I expected the following query is valid: SELECT ID, Subject, Type, (SELECT Field, OldValue, NewValue FROM CaseHistories) FROM Case But I get Didn't understand relationship 'CaseHistories' error. I ...
2
votes
2answers
67 views

Salesforce group by

I want to use group by from salesforce query : SELECT Candidat__c, Commande__c,Statut__c,IsDeleted, TypeContrat__c FROM Candidature__c WHERE Candidat__c = '0032000001GAPoXAAX' AND Statut__c = ...
1
vote
3answers
48 views

SOQL sub query will not work

My GC_Employee_Action__c object has two lookup relationships to the parent Employee__c object, eg: 1 lookup for employee and 2 lookup for his manager who also is an employee. I have the following ...
0
votes
2answers
40 views

How to Insert data in to Related List on Contact Object

Below is the apex class which i have written to insert data in to related list on contact.i am not getting error while executing the class but the data in not getting saved in the related list ...
1
vote
0answers
33 views

Querying Address Field On User Object , Giving Error On Compilation OF test classes in sandbox?

User fromUser = [SELECT Name, CompanyName, Email, Address, FirstName, LastName, Phone FROM User WHERE Id = :UserInfo.getUserId()]; this problem occurs when client installed our ...
7
votes
2answers
40 views

Cannot query UserRecordAccess for Tasks

I am running my query using the Rest API, but I have reproduced the issue in Workbench as well. The below query works for Account, Opportunity, and Contact, but fails for Task: SELECT ...
4
votes
0answers
40 views

SOQL not returning row (when it should be)

Running into a very weird issue that is actually causing preventing my IDE from compiling (mavensmate)... When Mavensmate compiles, it first checks the server version of the file to make sure it can ...
2
votes
3answers
36 views

How can I make this SOQL query with Apex variable?

I have these objects and relationships in my org: Contract__c >- Account -< IL__c Where >- and -< mean many-to-one/one-to-many relationships. So Account can have many Contract__c's and ...
0
votes
1answer
34 views

Combining two SOQL queries into one

I have the following SOQL queries Double counter1= [Select count( ) from Opportunity where createdDate >= Last_n_DAYS:30 and isClosed=true and Stagename!='Rejected' ]; Double counter2= [Select ...
0
votes
1answer
62 views

bestpractice for calling apex methods

I have a class that calls to an apex method with in a for loop and that method in-turn calls other apex method. All the methods have SOQL's in them. Running into 101 SOQL issue. for(sobject ...
0
votes
1answer
25 views

Facing problem for a Group by multiselect picklist

I have a multiselect picklist called status with 3 values and 5 amount fields..The problem that i am facing is that whatever value i select from status,My code is grouping by for all 3 values. For ...