Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [soql]

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

Filter by
Sorted by
Tagged with
-1 votes
1 answer
33 views

Workbench SOQL - Aggregate Relationships not supported in Bulk Query

I am receiving error for the SOQL query I ran in Workbench for Bulk CSV: Failed: InvalidBatch : Failed to process query: FUNCTIONALITY_NOT_ENABLED: Aggregate Relationships not supported in Bulk Query ...
DigitalCS's user avatar
0 votes
0 answers
38 views

Test Class Failure during deployment with tests due to SOQL on QueueSobject

Got an odd scenario where a test method fails during deployment due to the QueueSobject query not returning the expected queues. The original query is SELECT QueueId, Queue.DeveloperName, SobjectType ...
Tony White's user avatar
0 votes
1 answer
37 views

Why am I able to see a lookup record's name field if I don't have access to the record

I have an Object A and that has a look up to an Object B. There is a record A1 in Object A and there is a record B1 in Object B. Record B1 is a lookup on A1. The user has access to record A1, but does ...
Sanch S.'s user avatar
0 votes
0 answers
34 views

Can't query record from ServiceResourceSkill object

I need to query record from object ServiceResourceSkill in apex class but system return no record event thought there're still records inside it. Here some informations: I ran this apex class by a ...
Tuấn Trần quốc's user avatar
0 votes
1 answer
32 views

SOQL on FieldDefinition object - "LIKE" and "NOT LIKE" Return Same Results?

Somehow, these two logically opposing queries return (almost) the same data. How in the world do EntityDefinition.QualifiedApiName LIKE '%ChangeEvent%' and NOT EntityDefinition.QualifiedApiName LIKE '%...
number41's user avatar
  • 960
3 votes
1 answer
57 views

Why does `EntityDefinitionId` works like SObjectType in following code?

Let's say I want to retrieve all the fields with master-detail for each objects for given PermSet. Why can we provide SObject type array instead of Ids? And how can I can retrieve SObjectType as well ...
pincet's user avatar
  • 925
5 votes
1 answer
109 views

How to write SOQL query to get accounts where billing city equals to shipping city in single query?

This question asked in interview. As per my knowledge, it's not possible to get in single query. Is it even possible? If yes, then how? Please answer this question. Thank You!
nikita yadav's user avatar
0 votes
0 answers
21 views

Will Large Data Volumes Affect the Performance of Custom and Activity Objects?

We plan to associate a custom object with the activity object to record the actions of our sales personnel. Based on our preliminary estimates, both the custom object and the activity object will ...
Lex's user avatar
  • 11
8 votes
1 answer
195 views

Picklist field returning values instead of API Names in SOQL after Summer '24 release in sandbox

We have a query in similar format SELECT COUNT(Id), toLabel(Picklist_Field__c) alias, Picklist_Field__c FROM Account WHERE Id = 'acct id' GROUP BY Picklist_Field__c ORDER BY Picklist_Field__c The ...
Borz998's user avatar
  • 101
-1 votes
0 answers
30 views

OpportunityTrigger: System.LimitException: Too many SOQL queries: 101

I'm not sure if you can help. I'm just an admin, not a developer. but when I try and Mass Update using Dataloader, I get that error message. Wondering if anyone could fix it for me so I don't get that ...
MyaH's user avatar
  • 1
7 votes
1 answer
1k views

I'm exceeding 50k query rows with a child query, and no exception. Why does this work?

TL;DR I wrote a query on Account with a subquery for ChildAccounts It's returning more than 50,000 rows total (25k parent accounts + 60k child accounts) I have no idea why I'm not running into the ...
Derek F's user avatar
  • 62.1k
2 votes
1 answer
76 views

Why SOQL automatically retrieves Owner data, although I don’t specify it in the request?

My Apex Test failed with the following error: Cannot specify both an external ID reference Owner and a salesforce id, OwnerId. It throws on attempt to Database.update a record. In the debug, I’ve ...
Duck The Developer's user avatar
2 votes
2 answers
119 views

fflib: selector Method query giving me error of Duplicate field selected

I have created following method in my Opportunity selector class. I am passing my query fields dynamically from another class. public List<Opportunity> selectByDynamicFilter(List<String&...
Pj35's user avatar
  • 38
-2 votes
1 answer
56 views

SOQL "FOR UPDATE" keyword Understanding

Can someone please help me in understanding of the FOR UPDATE keyword in SOQL. Exactly when should we use this, what is the need to put an explicit lock on record? Whenever we do any DML, by default ...
Nitish Yadav's user avatar
0 votes
0 answers
31 views

Get Lightning Page Tab name by Id

I need to show Buttons in an LWC according to the visibility of some tabs for the current user. I show the respective button if the tab's visibility is 'DefaultOn'. If not, I don't show the button. ...
Max Collao's user avatar
-1 votes
1 answer
74 views

SOQL write a query to find the 3rd least annualRevenue on account

eg: if I have the following annualRevenue in ascending order. 10 10 10 12 15 16 18 19 then I should get 15 as the output.
J.Rosnovski's user avatar
2 votes
1 answer
56 views

Determining Flow Orchestration Version from a Flow Interview

I am trying to find a way to determine the running flow version of an orchestration using the Flow Interview Id. When looking at the Flow Interview page from Paused & Failed Flow Interviews I get ...
Liam Gatt's user avatar
  • 139
0 votes
1 answer
64 views

How to merge objects in query?

I have 2 custom objects. Let's say its customObj1__c and customObj2__c. List<customObj1__c> obj1 = [SELECT Id, Name__c, Age__c FROM customObj1__c ORDER BY CreatedDate ASC]; List<customObj2__c&...
Saber's user avatar
  • 1
0 votes
0 answers
58 views

Bulk API query - escaping quotes in JSON payload

I am building an app to access and curate data from a salesforce installation. We will be organizing manufacturing companies, but many companies inside the salesforce DB are non manufacturing. In the ...
Nicholas Finch's user avatar
0 votes
0 answers
37 views

can I create SOQL or SOSL command to get content of a report?

I know nothing about SF. I want to get content - preferably as .csv - or a report that someone created for me. I do not have SF account. I have access to an integration account that I managed to ...
Radek's user avatar
  • 101
0 votes
0 answers
25 views

SOQL CRMA BINDING error

I have this query and it functions correctly until i select a filter value. Been trying to fix it and don't understand what could be the error or if there is limitation for SOQL and CRMA functionality....
Sandeepan Mukherjee's user avatar
0 votes
1 answer
117 views

Salesforce Inspector crashing when copying large results

When trying to copy the results of a query (excel, csv, or JSON format), Chrome will crash completely. The query itself will complete successfully, only when copying will the browser crash. This is ...
janp's user avatar
  • 11
1 vote
0 answers
54 views

REST API query doesn't understand custom relationship while it worked with CLI

We're trying to query our Salesforce data from another process. A colleague did a PoC with his own credentials on the CLI and got results. The query he created contains custom relations and that ...
Ashala's user avatar
  • 11
0 votes
1 answer
49 views

Temp table or table type in SOQL

I have an apex remote action. Inside of it, I want to make an SOQL query. I want to create a query that is as close as SQL: SELECT Id, Text1__c, Text2__c FROM MyCustomObj__c t1 JOIN #TempTable t2 ON ...
khoa_chung_89's user avatar
1 vote
0 answers
32 views

Can't figure out why list aura component won't display the account name

It's meant to pull the recordId from the url of a users record page and use it to display a list of that users open opportunities. Everything is working without a hitch, except the account names aren'...
SethH's user avatar
  • 41
1 vote
1 answer
40 views

Quick way to update all objects on a Perm Set to "Read Access"

Going through Setup > new Permission Set... it seems it would take a long time to update all Objects to Read Access, and make sure Edit Access = false. Is there a faster way in Workbench or ...
Ryan McNeely's user avatar
0 votes
0 answers
32 views

Show most recent description from Activity on Account

We have a requirement to show the most recent description from the associated Tasks to the Account Page , Lightening Record Page Component ( eg: select Description from Task where Description != ...
Vin's user avatar
  • 11
1 vote
1 answer
155 views

SfdcSqlException: ORA-04023

This is the problem I am getting. System.UnexpectedException: common.exception.SfdcSqlException: ORA-04023: Object select /Apex.Class.YourBatch.start: line 108/ * from (select "Id", "...
YCS's user avatar
  • 27
-1 votes
1 answer
56 views

Aggregate results along with respective record names

How to get the MAX(Amount), Min(Amount) from a list of opportunity records with respective Opportunity Names in a single SOQL query. for(AggregateResult agResult : [Select Name, MIN(Amount) 'MinAmount'...
indrasen neelam's user avatar
-2 votes
1 answer
52 views

Why custom object cannot be a parent in (Parent to child) soql query? [closed]

Parent Object: Appointment (Custom Object) Child Object: Opportunity (Standard Object) My question is can we set custom object as parent in parent to child SOQL query? I know there are few types: ...
Sridhar's user avatar
  • 49
0 votes
2 answers
42 views

Get PriceBook items details using Pricebook id in nested query

I have an sObject called Edition, it has the related PriceBook id, how to get the items of the PriceBook when querying the Edition details: What I tried: query = f""" ...
B. Mohammad's user avatar
1 vote
0 answers
44 views

OpenActivity and ActivityHistory SOQL restriction for standard user

I am aware about other questions related to OpenActivity and ActivityHistory objects. These objects are not queryable directly so my working soql looks SELECT Id, (SELECT ActivityDate, Id, ...
Pavel Zaverach's user avatar
-1 votes
1 answer
46 views

Too many query rows: 50001 in Production

We are getting Too many query rows: 50001 error in production during a data load activity of an Sobject. we have an active trigger on this Sobject. But we have only 14K records for this object in ...
Raham's user avatar
  • 43
-2 votes
1 answer
43 views

SOQL query Contact name not queryable [closed]

what is the issue from my SOQL query- Select id, name,Status,type,LastModifiedDate,CreatedDate,Campaign.name,Campaign.Id,Campaign.Contact__r.id,Campaign.Contact__r.Name from CampaignMember where type='...
sfdcCoder's user avatar
0 votes
1 answer
82 views

Nested query doesn't work

EDIT: I am using simple-salesforce with the REST API to make requests. I'm trying to get for each Case all the EmailMessages, and for each EmailMessage, all its ContentDocumentLinks (from which I can ...
Labo's user avatar
  • 111
0 votes
0 answers
35 views

Too many query rows exception during Data load

We have a trigger on a parent object where we query the child records for newly inserted/updated parent records. We are getting too many soql exception when more than 50K parent records are loaded. We ...
Raham's user avatar
  • 43
0 votes
1 answer
33 views

Query in apex attribute of a component

Is it safe to put soql query as a string in apex attribute of a component? Or is it a stupid idea? For example <apex:component controller="somecontroller"><apex:attribute name = &...
Janek's user avatar
  • 1
0 votes
1 answer
54 views

How to get the minimum and maximum closedate from Opportunity object without hitting query limit

I have a checkbox lightning-input filter on a dashboard that needs to show all quarters that opportunities have been set to close (Q2-2023, Q3-2023, Q4-2023, Q1-2024... etc). Therefore, based on User ...
louis's user avatar
  • 81
1 vote
0 answers
100 views

Field 'Passport_Number__pc' cannot be filtered in a query call

This might be a basic question. My SOQL is failing in Prod: [SELECT Id, Subject FROM Case WHERE Account.Passport_Number__pc =: value] Field 'Passport_Number__pc' cannot be filtered in a query call ...
d_k's user avatar
  • 1,291
0 votes
0 answers
28 views

SOQL Injection Vulnerability question [duplicate]

I am looking at some of the classes that are written and I am confused if this soql is vulnerable or not. I understand that anything with '%' + searchTerm + '%' is issue for soql injection, but how ...
mike's user avatar
  • 61
0 votes
1 answer
72 views

Workaround for Offset limitation

I am currently working on setting up REST service in salesforce where in consumer can pass few parameters based on which there is logic to build and combine SOQL results and send in response Sometimes ...
sf_user's user avatar
  • 2,260
0 votes
1 answer
106 views

SOQL in Developer Console returns just one record for FieldDefinition object

Why does the Developer Console return just one record in a scratch org when I query the FieldDefinition object? The header says 46 rows, but it shows only one in the data table.
dev4life's user avatar
  • 520
0 votes
1 answer
47 views

Query Accounts from Individual in a Parent-to-Child SOQL query

This is a case in Salesforce: There is a lookup relationship from Account to Individual, both standard objects. How to write a parent-to-child SOQL query where Individual is the parent and Account is ...
Gnopor's user avatar
  • 151
0 votes
1 answer
51 views

SOQL query on child object to retrieve parent record name

I want to run a query on the 'PermissionSetAssignment' object but I want get the name of the permission set and user instead of their ids. SELECT IsActive, Id, PermissionSetId.Name, ...
Goat123's user avatar
0 votes
0 answers
58 views

Join two different picklists on value

I want to join two picklists on Value (Country) to have a result like below because I noticed that for some Markets one of the picklist values is missing either IsoCode2 (Aruba) or IsoCode3 (Bonaire). ...
surfmuggle's user avatar
0 votes
1 answer
54 views

SOQL - Relationship extract json from child object and join picklist label

This soql SELECT Id, Name, (SELECT CountryISOCode__c, Name, Role__c FROM Person__r) FROM Market__c returns a row that looks like this: Id NAME Person__r a081.. C1 [{"A":"foo", &...
surfmuggle's user avatar
0 votes
1 answer
59 views

SOQL Query on FieldPermissions

I want to list out Read and Write permissions for a few fields on an object from a profile. I have a profile named Master_Junior and under the profile I want to find out all the field permissions from ...
Niklaus's user avatar
0 votes
1 answer
41 views

Should an Access Token be renewed for every call using JWT?

Using the OAuth 2.0 JWT Bearer Flow, when does the Access Token need to be renewed? Let's say the JWT Flow is used to send queries to Salesforce from time to time. Should one request a new Access ...
Z0q's user avatar
  • 59
0 votes
0 answers
17 views

Failed to query Roles in Public Groups

I have created a public group and added some roles to it. However, when I try to query the roles in that group using the following SOQL query, I am unable to do so: SELECT Id, Name, DeveloperName, ...
Vivek Tendulkar's user avatar
1 vote
0 answers
24 views

If a "Get Records" element fails to find records, does it count as an interview?

#1 Disclaimer: if anyone have an opinion about this data structure, please let me know. So, after looking at the picture of the Schema Builder, here's the scenario: The Instrumento Contratual (IC) ...
Matheus Boechat Alcântara's user avatar

1
2 3 4 5
119