Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [soql]

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

0
votes
2answers
10 views

How can I use a SOQL query to get the number of AccountTeamMembers on an account?

I can write something like this to give me the AccountTeamMembers on all accounts select Id, (SELECT Id, AccountId FROM AccountTeamMembers) From Account but I don't know how to just get the count of ...
0
votes
0answers
15 views

how to upload attcahment from visualforce page to document object? [on hold]

Here i have an contract standard object and document standard object and created a record in contract object and attached a file (doc or pdf) in note & attachment list. create a custom button(move)...
0
votes
1answer
56 views

Too many SOQL queries: 101 and Triggers

SHORT VERSION: I'm getting a "Too many SOQL queries: 101" error on my production environment when updating some Leads through an external application. The theory is that it's due to multiple nested ...
0
votes
0answers
9 views

How to access the Schedule ID for each instalment of a LineItemSchedule

I have Products that have schedules with just one revenue amount (and date) and there are some that have two installments. When exporting this LineItemSchedule object, I can only see the second ...
0
votes
1answer
34 views

SOQL to return COUNT value via Apex

I am trying to return the SOQL listed values into a field using an Apex Trigger:- Object: Name = RPA__c Fields: Business_Area__c (picklist) VALUES = Finland Managed Services, UK Managed Services ...
2
votes
1answer
16 views

Does For update lock subquery records?

I tried searching a little bit but haven't found the answer yet. Suppose I am having a query: Select Id, Name, (Select Id, Name From OpportunityContactRoles) From Opportunity For Update Will the ...
-3
votes
1answer
27 views

SOQL Query -REST API [on hold]

I would like to know if it is possible to insert or update records using a SOQL query in the REST API. thanks
1
vote
1answer
22 views

SOQL query with IN operator on deterministically encrypted field returns different data

I have a SOQL query that uses the IN operator to find some Contacts by Email: Set<String> emailSet = new Set<String>{.......}; Map<Id, Contact> contactMap = new Map<Id, Contact&...
1
vote
0answers
28 views

Will connecting PowerBI to Salesforce hit the SOQL query limits? [closed]

Will connecting PowerBI to Salesforce hit the SOQL query limits? I don't find this in the documentation. EDIT2: If I connect to approximately 6 of 2000 objects in my enterprise salesforce ...
0
votes
1answer
20 views

System.QueryException: value of filter criterion for field 'CreatedDate' must be of type dateTime

Below my code, I want to pass date value as a parameter but I facing an error as below, message: System.QueryException: value of filter criterion for field 'CreatedDate' must be of type dateTime and ...
0
votes
3answers
24 views

SOQL Search function of Contact Name With Account Parent to Contact Child

I have 2 fields in my Search function with Account Name and Contact Name. The scenario will be, If the Contact Name has a value 'nothing' it will query in the Account to Contact relationship with ...
3
votes
1answer
39 views

How do lookup relationships work with force:data:tree:export? Don't know where to start

I'm trying to import and export data between scratch orgs using force:data:tree:export, and I'm having trouble finding documentation that explains how to handle lookup relationships. Lets's say that ...
2
votes
1answer
28 views

Alternative for lambda expressions in apex salesforce

I know that Salesforce does not support lambda expressions and query syntax (like in LINQ) queries in apex collections. But, It would be a nice feature for developers. Has anyone tried implementing ...
2
votes
1answer
23 views

Subquerying filtering on main query field

My intention is to filter the child records which are != to a field of the master. Account: Master Application__c : Child Using Subquery: select acc.id,acc.Callista_Org_Unit_Code__c , (select ...
0
votes
1answer
39 views

Need Help on Modifying Code [closed]

I found this example on a dynamic hierarchy for Accounts and I need help as to how to modify it to display an account hierarchy. I am unable to figure out why I recieve this error message when testing ...
0
votes
0answers
29 views

Lightning Error Message Question

I'm trying to create my own Account Hierarchy link that displays more than 500 accounts and its children utlizing lightning componenets and lightning out. I keep recieving this error whenever testing ...
0
votes
2answers
13 views

Getting error message while calling Contract field from Account Object

select Name,UltimateMotherKIS__c,contract__r.Name FROM Account ^ ERROR at Row:1:Column:34 Didn't understand relationship 'contract__r' in the field path. If you are ...
-1
votes
0answers
16 views

SOQL for Order and Order item [closed]

Need help for SOQL to compare the Total Amount (Order header) and total price (for all line items) that are not equal and date from last year till today. It seems line there are some Total Amount ...
0
votes
2answers
46 views

Race condition Soql with order by

I have a lead owner assignment logic with many conditions. When user presses a button "Get lead" a lead in the org is searched and ordered by the field rank (Soql order by rank__c), and when the lead ...
6
votes
2answers
206 views

Not all records returned in SOQL Query

I have a query that I'm using to export data: SELECT c.Id, c.SystemModstamp, ... FROM Contact c WHERE c.SystemModstamp > start AND c.SystemModstamp < end AND c.Id > string ORDER BY c.Id ASC ...
0
votes
1answer
21 views

Error Message Question

I'm new to salesforce and am unsure how to approach this error message. I had created this class that rolls down a Contact Role from a Contact created on a Parent to its children and a trigger that ...
0
votes
1answer
14 views

Want to fetch field from AggregateQuery

I created a Custom Settings and add some records in it. On the basis of that value i write an aggregate query and i want to store that field value in String. // List to fetch all records from ...
3
votes
2answers
184 views

SOQL getting the grandparent of an account from contact

I am trying to get the Ultimate Parent Account from my contact up to 3rd level parent. Here is my SOQL code: SELECT Name,Account.Parent.Name, Account.Parent.Parent.Name, Account.Parent.Parent.Parent....
0
votes
1answer
23 views

Custom Hierarchy Error

Hello I am relatively new to Salesforce and am trying to create a visualforce Account Hierarchy page that displays more than 500 accounts. I'm receiving this error whenever I test out my link on most ...
0
votes
1answer
35 views

Aggregate SOQL Query Cannot Aggregate

In my Product Object there is a list of ProductMatrices. I want to total sum of matrices field. So for that i used Aggregate soql. But its not showing aggregate result. public List<AggregateResult&...
1
vote
2answers
57 views

How can we skip the some records through SOQL

I am retrieving attachments through jitter bit SOQL query, but my all records are not retrieving through in the bulk so I have set the limit of 1000 but when I have download next 1000 records how can ...
0
votes
2answers
80 views

Many Lookup Relationship for One Object

I have the case of an object having two lookup relationship and I call for a list containing both relationship as follows. This is my Setup code public static List<Job_Application__c> ...
1
vote
2answers
41 views

What is the right way to query all Notes & Attachments?

I would like to query all notes & attachments, lets say for an Account. I uploaded 2 different files in the notes and attachment area but if I do the query: select id from attachment I do not ...
0
votes
1answer
22 views

How does joining two custom objects into one custom object through master-detail relationship work

I've been working on a test method but I've had a problem creating the setup of it. public static List<Job_Posting__c> createPostings(){ List<Job_Posting__c> testPostings = new ...
-1
votes
1answer
38 views

Fields can see in workbench but when i query it says no such column on entity

I can see the Mediumphotourl field for the user object in the workbench but when i try to query it i am getting an error No Such column 'MediumPhotoUrl' on entity 'USER'
3
votes
1answer
39 views

ParentId field on DuplicateRecordSet seems to be not visible

I was trying to create a Process (using Process Builder) to update a Duplicated Lead with it respective "Parent Lead", through a custom field "ParentLead__c". But on when I was navigating from ...
1
vote
1answer
22 views

How do I assign Delegated Administration via DML or query it via SOQL?

I would like to assign power-users to be admins of Delegated Administration groups a bit easier than the click-through manual process. Is there a way I can query admins via SOQL or assign admins via ...
0
votes
2answers
20 views

Bulk match contacts based on email

I've a list of email ids and I want to match it against contacts in Salesforce. I'm planning to do use SOQL like - Select Id, Name from Contact where email IN ('a@xyz.com, b@xyz.com') I will be ...
0
votes
1answer
25 views

Indexed Big Object SOQL limitation in Apex class

Due to the Data storage limits in our Salesforce Instance, we have created a big object with 3 Indexed fields. Now, when I use this Big object in an apex class to search for a particular value from ...
0
votes
1answer
19 views

SOQL querying ID's only returning first result

I have a custom object called "Call_List__c" which has a field named "Call_List_Members__c". This field has a list of Contact Id's separated by commas. In an apex class, I split the "...
0
votes
0answers
30 views

Querying for ContentDocumentId returns resutls whereas ContentDocument.Title doesn't

I have a VF page in a community that queries for files in the ContentVersion table. If I run the query like so... return [SELECT Id, Title, Description, Checksum, ContentSize, PathOnClient FROM ...
-1
votes
1answer
40 views

Combining two SOQL but getting error

I have many column on my object. I was getting error Query is either selecting too many fields or the filter conditions are too complicated.  so trying to split in two query the combining result. ...
0
votes
1answer
27 views

Sharing rules in process builder and flow - Too many SOQL queries: 101

I created a flow that is supposed to remove manual sharing of contracts when editing the field on the contact. The contract owner (partner user) has a custom field in which I enter the manager and the ...
0
votes
2answers
38 views

Trying to execute 2 nested SOQLs, not getting the expected result

Here I am trying to filter the the records based on the output provided by the first soql, not getting the result I am looking for. public class DMLTest { public void DMLtesting() { List&...
0
votes
2answers
43 views

Trying to access unique records and the records of those unique records from the same table

select Id, Name from sumchans__AddressReportMATeam__c where Name in (select Name from sumchans__AddressReportMATeam__c group by Name LIMIT 3) I am not sure how to explain what I am trying to get here....
0
votes
1answer
30 views

soql of List<Task> and <Account>

Our incoming calls are saved as Tasks, and related to a temp account. If the calling number already exists in an account, we want to relate that task to the account. First, we make a list of the ...
0
votes
1answer
45 views

DLRS Formula question [closed]

Okay so we have a custom object called Encounters and then we add Attendees (custom object) to the encounters. Attendees have a lookup field to contacts to connect to the what Encounter they attended. ...
0
votes
1answer
41 views

SOQL Not Returning Expected Result

I have a very basic method that correctly returns the value of the Name field of my custom object. However, when I try to retrieve the value of a custom field I get isnull as the result. I checked ...
1
vote
1answer
28 views

Notes & Attachments Cant find using soql

I did not get any result from querying notes and attachment. Setup I create a custom object. I added notes and attachment to the custom object I created soql that filter by parentId and it looks like ...
2
votes
1answer
22 views

SOQL for getting records in QTD

I am trying to fetch records using SOQL where purchase_Date is in QTD (Quarter To Date). Select id from object__c where THIS_QUARTER <= purchase_Date__c AND purchase_Date__c <= TODAY I think ...
0
votes
1answer
19 views

Apex: can't use a lookup reference retrieved using SOQL query as a function parameter in a recursive function

I'm refactoring a recursive function to avoid hitting governor limits on SOQL queries. In order to keep SOQL queries out of a for loop, I'm using dot notation to retrieve a lookup relation (Residence)...
1
vote
2answers
133 views

Error encountered with usage of != or <> operating for SOQL query in batch class

I get the following error in Developer Console (logs) while executing this batch class with the following code snippet. 20:07:09:029 FATAL_ERROR System.QueryException: expecting a colon, found '(' ...
0
votes
1answer
71 views

Malformed Query

UPDATE: Changed query from dynamic to static. Still have malformed problem. I have a malformed query problem. Could somebody help? It works in my batch class, but not my normal class. [...
0
votes
1answer
34 views

Compare fields in lightning component

I have a lightning component which the goal of it is to open a page if some fields on the record are not null, how to compare those fields to null? Here the component: <aura:component controller="...
0
votes
1answer
29 views

Search Account Based on Name field

I want to query on account fields such that if i search using alphabets on vf page it must show account name based on starting Letter not in between lt has to search.How can I do This? <apex:page ...