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
vote
0answers
22 views

SOQL Query On Junction Object Not Return Data For Site Guest User

I have created a junction object called 'Test1__c' between Opportunity and Contact, soql query on Test1__c object return nothing and got below error. "System.QueryException: List has no rows for ...
0
votes
1answer
30 views

Multiselect picklist and owner id validation

An administrator uploads the data in the custom object, By giving the ownerid and the multiselect picklist values. Each owner can be assigned each multiselect picklist value only ones. Example : A ...
0
votes
3answers
28 views

Getting error while trying to fetch list of open cases related to Account -SOQL Query

public class CaseAccount { public static void (){ Account accts=[SELECT Id, name FROM Account WHERE Id NOT IN ( SELECT AccountId ...
0
votes
0answers
9 views

how to get the Knowledge__kav custom fields using the KnowledgeArticleVersion object

I am using the knowledge(Knowledge__kav) object with 4-5 custom fields. For an article having 5 version. How can i query the archieved article version with the custom field using ...
0
votes
1answer
37 views

Composite Graph SOQL Support

I can't find an example of executing SOQL using the Composite Graph API. My request body { "graphs": [ { "graphId": "graph1", "...
0
votes
0answers
26 views

SOQL query to get products related to a case

Good afternoon. I am confused as to why I can see a Lookup relationship on Schema Builder, linking Case and Product (Product2?) objects, but when I click on "Open Resource => Case.obj" ...
-1
votes
0answers
55 views

How to check a where condition on inner soql query?

How to check a where condition on inner query ? I am written a soql query to check an inner condition. I needs to check a condition dynamically only when the Model_Code__c matches with the particular ...
0
votes
0answers
25 views

Get field name if field is fdild is ID

I am constructing dynamic custom look in LWC , and I want to display the name of look up automatically if the field is ID field. In the dynamic query I can just able to pass only the ID of look up ...
1
vote
1answer
46 views

Simple Salesforce Query issues involving Malformed requests

I have a malformed query problem when using simple salesforce for my AWS python Lambda. The query uses the AccountContactRelation object. When an event is dropped into an AWS S3 bucket for taxonomy ...
2
votes
0answers
17 views

Why doesn't the System user have access to the CollaborationGroup records?

I've created a test class and a simple flow below that illustrates the issue with the System user. Two test methods are doing a simple SOQL query on the CollaborationGroup records (one with a Standard ...
0
votes
0answers
10 views

Returning the Territory Model name and Territory Name based on Account ID

I am trying to populate a custom field on my account object called "Original Territory" that tracks the value of a territory name from the associated Territory2 record. I am trying to create ...
0
votes
1answer
29 views

How to query only the labels for custom or standard objects

SELECT Fields(standard) FROM Contact This queries all the records of all the fields in the Contact object, but I want to query only the labels of the fields so that I can create a picklist of all the ...
0
votes
0answers
11 views

soql knowledge inner query error [duplicate]

When i try to write an inner query using knowledge object its fetching error. having the Applicable_model__c is a custom object. SELECT Id, Title,(Select Id from Applicable_model__r) FROM ...
0
votes
1answer
19 views

How to get bottom records & between records from an object

I am trying to take backup of a table which contains 1,472,902 records. As the data is huge i am trying to split the data into top 500k, middle 500k & bottom 500k records. I got top 500k records ...
2
votes
1answer
58 views

Which Tooling API Objects can be queried in Apex?

I would like to know which objects I can query in Apex which are not listed in the SOAP API Developer Guide but are listed in the Tooling API Developer Guide. Is there a list maintained somewhere?
-1
votes
1answer
37 views

How to add value into a map which is stored in another map?

Map<Id, SObject> accQuery = new Map<Id, SObject>(); Map<string, Map<Id, SObject>> queriesList = new Map<string, Map<Id, SObject>>(); queriesList.put('select * from ...
0
votes
1answer
31 views

LWC Add Remove USERS from a selected Group.Name (Queues or PublicGroups) from a Dual List Box

After I moved a user from a selected group (Queue Marketing) for example, to the left or right side of the dual list box. -left side has: List of Users from the Org where Queue MKT is not part of -...
0
votes
2answers
40 views

How to show a list of ALL USERS NAMES who belong to a selected Group and a list of USERS who don't belong the selected Group

For the moment I have this Query: SELECT userorgroupId, GroupId, Group.Type FROM GroupMember WHERE groupId ='00G09000000vV44EAE' AND Group.Type='queue' I am ...
0
votes
1answer
31 views

Query based on field equal to field in another query

I have a custom object that has for name a string that matches the BillingPostalCode field from different Accounts objects. I'm querying some accounts, and now I want to limit a query of this custom ...
-1
votes
0answers
25 views

From parent record to get all the child category records like recursive [duplicate]

Needs to get the category hierarchy from top to bottom Which mean we have c1 code from c1 needs to get c1-->c2-->c3-->c4--> etc,. I have an 'category' object it stores all the category ...
1
vote
0answers
45 views

Get 10+ level category hierarchy relationship

Needs to get the category hierarchy from top to bottom Which mean we have c1 code from c1 needs to get c1-->c2-->c3-->c4--> etc,. I have an 'category' object it stores all the category ...
0
votes
0answers
12 views

Query and delete records off a Big Object

I've got an existing Big Object with millions of records in it. When it was originally built, only 1 unique ID field was indexed, and nothing else. I found this article from Salesforce that shows you ...
7
votes
0answers
55 views

Query highest value of custom Field on Large Object

Existing Logic: We have a trigger that gets the highest value of a custom Field "UIN__c" on various Objects and increments the value by 1 on each new Record. This Field functions as an ID ...
0
votes
0answers
12 views

Possible to query the Case Origin set on an email-to-case?

Is it possible to query the Case Origin that is set for each of the email-to-case? I've used this query SELECT Id, IsActive, LocalPart, EmailDomainName, Function.FunctionName FROM ...
1
vote
3answers
72 views

How perform SOQL query where criteria input is based on user language?

The context of this question is that I am developing a managed package. In the managed package there is functionality which should only be made available to system administrators. To check whether a ...
0
votes
1answer
31 views

Fill Map<String, List<Id>> from a list

I am trying to build a map<String, List<Id>> where the List<Id> is the list of UserOrGroupId field in the GroupMember Object that has similar Group.DeveloperName values and that I ...
0
votes
1answer
31 views

Insert record based on another record

For example a have account sobject and want to use record to create another record with mainly that record data. So same name and another fields, but some fields with another data. Is it possible to ...
0
votes
1answer
41 views

Optimise SOQL in APEX Class

In the APEX class, I am checking conditions as below - I am getting Oppty.Id as input parameter Condition 1: List<CUSTOM_OBJ> inprogressCheck = Select Id from CUSTOM_OBJ where OpportunityID = ...
0
votes
2answers
50 views

How can I make a year in a SOQL query variable?

So I can run a query such as WHERE Date__c > 2020-07-31 but then next year "2020" would be out of date. I'd like "2020" to be variable so that next year, when I run this again, ...
1
vote
2answers
76 views

Retrieve accounts that don't have any open opportunities

I want to write a query to retrieve accounts that don't have any open opportunities. I was looking at nested queries, so I wanted to run something like this: Select id from Account WHERE id = (SELECT ...
-1
votes
1answer
25 views

Performing filter based Queries on Salesforce using SOQL [duplicate]

I want to write an SOQL Query to ensure that contacts with the name John Johnson , together with all contacts with Last name Smith (excluding Benjamin Smith) will be selected. Please advise how to ...
2
votes
1answer
26 views

AccountName field not accessible on Order object

Not able to use this SOQL in Apex: Order currectOrder = [SELECT AccountNumber, OrderNumber, Type, Status FROM Order WHERE Id =: currentOrderId]; getting error: No such column 'AccountNumber' on ...
2
votes
1answer
126 views

QUERY_TOO_COMPLICATED pulling a specific record over REST API

We are pulling an account for a customer and after around 25 seconds it times out with an error. GET https://xyz.my.salesforce.com/services/data/v50.0/sobjects/Account/001xxx [ { "...
0
votes
0answers
8 views

Community file types

Is there any way to get the list of allowed file types in salesforce communities via apex so that we can put the same in LWC?
5
votes
0answers
46 views

APEX Schema ChildRelationships: why have some relationships their relationshipName = null?

There is some strangeness in the some standard Childrelationships. Most Relationships are as expected, but let us take Account and Quote as an example: On Quote we have a standard lookup field Quote....
2
votes
1answer
29 views

Is there a way to distinguish Long Text Area field or Rich Text Area field from a regular Text Area?

I need to build an interface to allow a user to filter record by the field chosen by the user. I know that I can use Text Area fields in the WHERE Clause but I can't use Long Text Area field or Rich ...
1
vote
0answers
30 views

Query External Object filtering by Date or DateTime dataType

first time ever writing here, hope anyone can help me: We're working with Salesforce Files Connect, currently configured and working with SharePoint. Users can browse files by certain filters we're ...
2
votes
0answers
23 views

Ignore wildcard

I want my SOQL to return ONLY those objects which have __c. However when I tried below it even returns me objects like ContentWorkspaceDoc, PushTopic, Topic etc. It assumes underscore as placeholder. ...
1
vote
1answer
29 views

Fetching records where the field value is null or similar to SOQL inner query

There is a sObject called Promo_Association__c which have a lookup field(Partnership__c) on Account object. There is a quick action on Opportunity layout and the requirement is to fetch Promo ...
0
votes
0answers
28 views

SOQL Statement to Query 'Session Security Levels' in session settings

I am looking for a SOQL Statement to Query 'Session Security Levels' in session settings. I want the state of these settings. I tried the SessionSettings object but it is not returning the required ...
0
votes
0answers
27 views

How To Write Query To Display RelatedList Records in inline datatable

I'm just trying to display the related records of custom object in inline data table. public with sharing class Offtake_Display { @AuraEnabled public static List<SBQQ__Quote__c> ...
0
votes
0answers
14 views

How do I use a value in a subquery with a lightning datatable? [duplicate]

I have a list created by a SOQL. I can display the regular values but the values by reference are not displaying. I have tried Actor.Name, and Name for the fieldName. What do I use? Thanks everyone. ...
0
votes
0answers
15 views

Removal of OptionsSiteAsContainerEnabled from query

I am looking for thoughts on the below... Salesforce provided a potential reason and fix for the white screen problem we have been intermittently experiencing when Guest users accesses Community. The ...
0
votes
0answers
34 views

Page Reference and If Statement

I am looking to add another if/or statement that will also look for if the phone number is Anonymous to be redirected to the contact page. Here is what I have. It is working but I need to add ...
0
votes
1answer
17 views

How to get the delegated Approver Email address?

I have logic in my custom code where I need to send an email to the custom approver and its delegated approver. But I am not able to get the email id directly in SOQL. List<Account> lstAcc = [...
0
votes
1answer
94 views

How to retrieve multiple objects records in the Batch Apex execute method?

I need to wrap records from Opportunity, Account, Quote, User objects. I need help with Batch Apex execute method. how to retrieve those records and wrap them with the wrapper class on execute method. ...
0
votes
0answers
16 views

Profile image url of current user

I have a custom object Employee__c which has lookup on User object. I have a requirement to get the associated user's MediumPhotoUrl field value to display the image in my lwc component. I am using ...
0
votes
1answer
39 views

RecordType.Name not working in SOQL

When I run the query select id, RecordType.name from account , I am getting the records but when I run the similar below query, I am getting error. select id, RecordType.name from opportunity The ...
0
votes
1answer
22 views

Query related Tasks does not work

I need to query all related tasks from a contact (currentRecordId) but my code below shows nothing. What I'm doing wrong? Map<Id, TaskRelation> relatedTasks1 = new Map<Id, TaskRelation>([...
0
votes
0answers
32 views

How to avoid SOQL Injection on the Below query [duplicate]

May I know, how I can avoid SOQL injections on the below query?? In the below query Filter can be anything like > or < or = Values are string one's. Functionality is working fine but injection ...

1
2 3 4 5
107