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
0
votes
0answers
27 views

Order by not working in SOQL query

I am trying to query by Discharge__c (custom object) record with the most recent discharge_date__c. This is the query I am using: Discharge__c dis = [select id, name_dob_formula__c, date_of_birth__c, ...
0
votes
1answer
57 views

How to clone/copy records using apex?

Trigger trigger TRG_LinkCampaing on Test_Campaign__c (after insert,after update) { set<Id> ParID = new set<Id>(); for(Test_Campaign__c TestCamp : Trigger.new) { ...
0
votes
1answer
463 views

Object Filter in SSIS Salesforce Source

I need to move all records from salesforce to a DWH using SSIS. After the initial run I need to move only the records that either got inserted or updated after the last run into SFDC. I learnt that ...
-1
votes
1answer
87 views

How to execute batch with Dynamic soql?

i use this query in my batch start method : SELECT Id, AccBill__c, OrderBill__c FROM FAB_Order_Bill_Price__c WHERE AccBill__c IN : CustomMap.keySet()OR OrderBill__c IN : CustomMap.keySet() batch ; ...
0
votes
1answer
630 views

Createdby cannot reference custom field?

I am struggling with the createdby reference and hope someone could help me out. I have a custom object and as everyone knows there is a standard createdbyId created on every custom object. We can use ...
2
votes
1answer
452 views

Calling a Visualforce Page from another and passing the ID

I have a visualforce page (a letter menu) that on the click of a button (downloads a PDF and saves a letter to the record): <apex:commandButton action="{!saveLetter}" value="Download Letter"/> ...
0
votes
1answer
31 views

How to fix SOQL Query Stored XSS

I have given my code for Security code Scanner but it is given the following error due to String attachmentQuery = 'SELECT id,E2CAdv__Attachment__c, E2CAdv__CaseId__c, E2CAdv__Attachment_links__c, ...
0
votes
1answer
27 views

SOSL - FETCH ALL ID OF MULTIPLE SOBJECT USING SOSL [closed]

Could you please tell me how can I fetch all IDs of multiple SObject in one query using SOSL. I would like not to use the below approach mentioned in the link, as it uses a for loop and inside it ...
0
votes
0answers
13 views

Query List Views Shared With A Particular Public Group

I have a Public Group named "Random Group" created in my Org and I want to query which all List Views are shared with this particular public group. Is there a way to query this? Thanks in ...
0
votes
0answers
9 views

How can we Get All associated Invitee of an Events in Salesforce through soql

I am trying to create a map of all events with associated invitee contact list. Like Map<Id, List<contact> inviteeMap= new Map <id,List<contact>>() Some how I am able to get only ...
0
votes
0answers
8 views

How to use SOQL to extract list of invalid emails from Data Extension imports?

I couldn't find any resource explaining this but I'm curious if the list of invalid email addresses identified during the import of records in data extensions are stored somewhere in Salesforce? ...
0
votes
1answer
21 views

unexpected token: BillingState

Im learning more about Batch Apex class and I find it pretty cool and helpful. When I remove the Where BillingSate='TX' everything works as expected. Yet when I use the Where condition I get the ...
0
votes
1answer
18 views

Inner SOQL Queries

I would like to know if there are any limitations to inner(nested) SOQL Queries. The reason i am asking is that lately when i get a soql 101 error it leads me to queries that have multiple inner ...
0
votes
1answer
29 views

SOQL Alias for Count() not working

I have this simple SOQL query: SELECT COUNT(Id) taskCount, WhatId Id FROM Task WHERE What.Type = 'Opportunity' GROUP BY WhatId I get the "Id" column but for the Count() I'm getting a column ...
0
votes
2answers
1k views

Apex Trigger with SOQL Query and Lookup Relationship

I have 2 objects called WorkRequest__c and WorkOrders__c. Each time our client receives a new request, a record is created on the WorkRequest__c object. Depending on information in each request, a ...
0
votes
0answers
13 views

GROUP BY ROLLUP gives labels as Null in SOQL Query

I am using GROUP BY ROLLUP in query to get totals & subtotals of aggregate columns.But while the result of total & subtotals are displayed i am getting their labels as Null instead of Total &...
1
vote
1answer
23 views

How to order a SOQL result set using FOR UPDATE

To lock records during the life of a transaction we use FOR UPDATE at the end of the SOQL statement. All good. One limitation is that you cannot use ORDER BY in conjunction with FOR UPDATE. If I ...
0
votes
3answers
613 views

How to write SOSL IN query

I've following SOQL query - SELECT Id, Name, Email, Account.Id, Account.Name FROM Contact WHERE Email in :emails Here emails is a comma separated list of email ids. Can I write the same query in ...
1
vote
1answer
51 views

Lightning component transaction context for SOQL queries

Do Lightning Web Components operate in their own transaction when it comes to SOQL query limits? For example, if I have a Lightning Page with several LWCs, can I focus on each LWC as a single entity ...
0
votes
0answers
12 views

Can historical EmailMessageRelation records be migrated? (CreatedDate is not writeable even with relevant permissions)

I am unclear how one can migrate EmailMessageRelation records because the 'CreatedDate' field is not writeable even with the relevant permissions ('Edit access on Read Only fields' and 'System Audit ...
-1
votes
0answers
24 views

AggregateResult to add to a list

The line of accList.add(AccId); is giving an error. How to fix it? List<AggregateResult> oppList = new List<AggregateResult> ([Select AccountId, sum(Amount) sumAmount from Opportunity ...
0
votes
2answers
33 views

SOQL Aggregate expressions

This class is still work in progress, how to resolve the error from Line 8 - 'only root queries support aggregate expressions' does this mean AggregateResult can't access values inside a subquery? ...
10
votes
3answers
10k views

What makes a field not groupable

I'm trying to use an aggregate query, but one of the fields I want to group by is not groupable (saw it in the soql error and then verified groupable=false in the metadata). It's just a number field ...
0
votes
1answer
15 views

How To Access AppTabMember Object in Salesforce Using Excel 2016 Power Query [closed]

I am trying to list all tabs per application in Salesforce via Excel 2016 Power Query. I was able to see the objects, but it doesn't include the AppTabMember. Only the AppMenuItem is available, which ...
0
votes
0answers
29 views

Can't get the table's description with SOQL or Rest Api

I'm trying to get the descriptions of the tables with SOQL query or Rest Api without succes till now. Any idea about how to do this? Thank you.
0
votes
0answers
34 views

Missing fields in User object when i execute an SOQL query [duplicate]

I've noticed when I execute the following query on Workbench developerforce that some fields are missing, however, these fields appear in the schema builder. This is in a developer edition org. The ...
4
votes
2answers
226 views

If I Use a Loan Pattern is Salesforce smart enough to do a SOQL for loop?

As we know, Salesforce does some magic when you do something like: for (List<Account> accountList: [SELECT Id, Name FROM Account WHERE Name LIKE 'Acme%']) { // do stuff } ... such that the ...
0
votes
1answer
16 views

Class to update Account's active__c not working

I made a class in a trailhead playground to query some opps, then the accounts, and some fields related to them. My objective was to access the Account's Active__c field and change the value from 'yes'...
0
votes
1answer
25 views

Soql IN Operator

This query works until adding WHERE clause, What's issue? Thanks! Select Id, Name, (Select ParentId, Name From Obj__r), (Select Name From Contacts) From Account WHERE Id IN (Select ParentId ...
1
vote
2answers
613 views

Modifying data using SOQL?

I'm using SOQL along with the SOAP API in order to pull a certain set of data to my webpage. However, I want to modify this data (two custom fields) and update the records in Salesforce itself. As I ...
13
votes
5answers
14k views

SOQL aggregate query limit [Updated for Summer18]

I'm trying to use aggregate queries to save work and script statements. The object has a field for each month representing energy usage for that month for a building. In situations where a building ...
1
vote
1answer
2k views

Passing a parameter to batchable class

I have the following batchable class: global class batchableClassName implements Database.Batchable<sObject>, Database.AllowsCallouts { global Database.QueryLocator start(Database....
0
votes
1answer
24 views

Using result from select query as variable on sub-query

Sorry for the title, I could not come up with a better one. Basically, I have the following query SELECT Id, (SELECT Name FROM Prod__c WHERE Id = Case.Id) FROM Case limit 20 So what I want to achieve ...
3
votes
0answers
1k views

Invalid Query Locator in REST API

When making a REST API query call from a Java client I'm getting an INVALID_QUERY_LOCATOR error. I'm familiar with the limitation around 10 query locators in the same time and in my code I'm avoiding ...
3
votes
1answer
755 views

Get Children Records out of Loops in Flows

Dear StackOverflowers, This is my first question on SO, so please bear with me if you find it naive. I have looked up and down the platform and surprisingly, I haven't been able to find a similar ...
1
vote
1answer
710 views

Feed Attachment to Content Version - Retrieve ContentVersion.PathOnClient

I'm attempting to pull case feeds with their associated attachment's meta-data. What I'd like to do is pull feed attachment data like I am in the attached query, however I'd like to add another field ...
0
votes
2answers
20 views

Want to use filter criteria in query for opportunity

Error in saving unable to apply filter on opportunity global class batchClassOppUpdate implements Database.Batchable<sObject> { global Database.QueryLocator start(Database.BatchableContext ...
0
votes
0answers
27 views

Query has results in query editor but none in code

When I call the following method in code I have a valid debug for communityIds yet the query returns 0 query rows. When I run the same exact query in the query editor with the same value for ...
1
vote
1answer
49 views

SOQL query on non-related objects [duplicate]

Account is a parent to Object B and Object C. Object B and Object C does not have any relationship. From Object B I want to find Object C's fields(like name etc.,) using Account in a single SOQL query....
0
votes
1answer
23 views

Map variables through query

i want to get the value of the confList to the guaranteeSOQL but i get the error: Variable does not exist: Replaced_Configuration__r how can i overcome this? list<Configuration__c> confList = [...
0
votes
0answers
16 views

ERROR running force:data:soql:query: unable to verify the first certificate

After authorizing the org successfully while executing SOQL query I am getting the above error in VsCode and also in cmd while executing sfdx force:org:list the connected status is showing unable to ...
0
votes
1answer
26 views

Didn't understand relationship 'SetupEntity' in field path Error in Salesforce Workbench

I am trying to query profiles having visibility with some applications. I used the following query: SELECT Id, SetupEntityId, Parent.Profile.Name, SetupEntityType FROM SetupEntityAccess WHERE ...
0
votes
1answer
18 views

Platform shield Encryption not enable for Email field

I am trying to enable platform encryption for the 'Email' field but I have used this field in my SOQL where clause. So, while enabling I am getting error as below: Contact.Email: Apex Class: ...
0
votes
1answer
20 views

Field 'PermissionsWorkplaceCommandCenter' can not be grouped in a query call [duplicate]

I am trying to get the value of PermissionsWorkplaceCommandCenter field per Profile in PermissionSets via Salesforce Workbench. At first, I have this query: But this results to following error: I ...
3
votes
1answer
413 views

SOQL Error on Querying External Object?

I am trying a simple Query on an External Object and it is returning this error :- An error has occurred and you have been logged out: REQUEST_LIMIT_EXCEEDED: Your org exceeded one of the rate ...
1
vote
1answer
31 views

jsforce Bulk API query is not returning records in proper json format?

I am working on a nodejs app that uses jsforce library to query data using Bulk API and the format of data returned doesn't seem to be proper json formatted. Here is a simple reproducible example: // ...
0
votes
1answer
575 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 ...
4
votes
1answer
1k views

Easiest way to delete a million records?

Been doing tests in sandbox in which I've created about a million accountshares that I need to get rid of for testing. I'm trying data loader in bulk api mode to export than delete but I keep ...
0
votes
1answer
25 views

filterable property in schema

how to get fields which are queryable(can be used in query) or filterable(property from schema) from an object like account without using soql queries. Any suggestions? how to achieve this.
0
votes
0answers
20 views

faultcode:'soapenv:Client'faultstring:'System.ListException:List index out of bounds:1

Need you help Badly on this . I got the above Error when cloning the Related list in opportunity object . We have a Rebid Opportunity button on the opportunity detail page,where it take upto 4 rebids,...

1
2 3 4 5
99