Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

#SOQL Queries2 discussing

Workbench - Bulk CSV export - Error: InvalidJob: Unable to find object: childaccounts

 

I'm getting an error when trying to run SOQL in workbench. The below query works fine if i choose the view as option "list", however if i choose "Bulk CSV" it throws an error? Any thoughts on how to export this without getting that error would be great :)

 

SELECT id, name, state__c, custid__c, (select state__c FROM childaccounts)

FROM account where owner.name = 'FAKE PERSON' and parentid = '' and solomon_address_key__c = ''

1 comment
0/9000

Hi all,

I need to read via ETL all the possible combinations of dependent picklist values.

Is there a way to obtain all dependent picklist values linked to the controlling field via SOQL?

 

tks

 

#SOQL Queries #Sales Cloud #Picklist Field #Dependent Picklists

7 answers
0/9000

SOQL 

Is it possible to create several WHERE in a query? 

I would like to do this:

 

SELECT FirstName, LastName from Lead

WHERE status = 'Converted' or status = 'not converted'

where CreatedDate <= LAST_N_DAYS:7 - where it shows me only records created in the last 7 days.

 

Thanks in advance for your help

 

Rocio

 

#SOQL Queries

1 comment
  1. Nov 28, 2024, 11:02 AM

    Yes we can do that. 

     

    SELECT FirstName, LastName

    FROM Lead

    WHERE (Status = 'Converted' OR Status = 'Not Converted')

    AND CreatedDate >= LAST_N_DAYS:7

     

0/9000

#SOQL Queries #Salesforce Admin #SOQL

 

SOQL QUERY: Query all flows in your Org. (Use Tooling API)

 

Select Id,DefinitionId,MasterLabel, ManageableState, VersionNumber, Status, Description, ProcessType, CreatedDate,CreatedById, TriggerOrder, RunInMode, ApiVersion, Environments, TimeZoneSidKey,  ProgressStatus from flow where Status = 'Active'

6 comments
  1. Oct 14, 2024, 9:18 AM

    You can also identify schedule-triggered flows with the query:

     

    SELECT id, IsActive, Label, ProcessType, ManageableState , TriggerObjectOrEventId, TriggerObjectOrEventLabel, TriggerType FROM FlowDefinitionView WHERE triggertype = 'Scheduled'
0/9000

[▶️]🔴🔥🎬 Write Mock SOQL Tests For External Objects

When we write any Apex class that involves some sort of DML operation around the External object, we need to write the test classes as well. Writing a test class is needed to make sure at least 75% of the code is covered in the test class with both positive, negative, and bulkified scenarios. In the case of SOQL statements, we normally create the test data in the test setup method and query them in the test methods. But in the case of SOQL, which involves External object, we cannot do that, and we also cannnot directly query the External objects. But test coverage is needed for the Apex class to be deployed in production. 

In Winter 25 Release, Salesforce brings the solution to this problem. Now we can write mock SOQL statements for External Objects. I will be showing that in this blog post and YouTube video.

🎬 https://youtu.be/IniZXsQbDH8

📒 https://sudipta-deb.in/2024/09/write-mock-soql-tests-for-external-objects.html

 

[▶️]🔴🔥🎬 Write Mock SOQL Tests For External ObjectsWhen we write any Apex class that involves some sort of DML operation around the External object, we need to write the test classes as well.@The Blog Group @* Release Readiness Trailblazers *

 

#Apex  #External Objects  #Winter25  #SOQL Queries  #Mock Test

0/9000

[▶️]🔴🔥🎬 Query Five Levels of Parent-to-Child Relationships in SOQL

 

The most recent version of SOQL allows relationship queries to traverse up to five levels of parent-child data. This implies that a single SOQL query can be used to retrieve parent-child records from five different levels.

Please be aware, nevertheless, that this capability is limited to doing SOQL queries on both standard and custom objects through REST and SOAP query calls.

 

The maximum number of Parent-to-Child connection levels for SOQL searches in Salesforce’s Apex class is still limited to two.

 

Relationship queries in SOQL can have a parent root as the first level and go up to four levels deep with child relationships starting with API version 58.0. With this update, developers may now create complex searches that retrieve data from several parent and child items simultaneously. Before this improvement, these kinds of inquiries were to be made as several independent requests, which added to the complexity and might have affected performance.

 

🎬 https://youtu.be/ZCALNDFaY6Y

📒 https://sudipta-deb.in/2024/06/query-five-levels-of-parent-to-child-relationships-in-soql.html

 

[▶️]🔴🔥🎬 Query Five Levels of Parent-to-Child Relationships in SOQL The most recent version of SOQL allows relationship queries to traverse up to five levels of parent-child data.

@The Blog Group

 

#SOQL Queries #Apex #Sosl #New Releases @* Release Readiness Trailblazers *

0/9000

[▶️]🔴🔥🎬 Evaluate Dynamic Formulas In Apex

 

“Evaluate Dynamic Formulas in Apex” is a new feature in Salesforce scheduled for release with Summer ’24 (currently in beta). It allows developers to programmatically evaluate Salesforce formulas within Apex code. This means you can write code that takes a formula as input (as a string) and evaluates it based on the context you provide, similar to how formulas are evaluated in fields or rules within Salesforce.

Here are some potential benefits of this feature:

  • Real-time Calculations: Eliminate the need to store pre-calculated formula results in fields, improving efficiency.
  • Increased Flexibility: Create more dynamic logic in automations, validations, and workflows by evaluating formulas at runtime.
  • Enhanced User Experience: Build custom formula editors that leverage the power of the Salesforce formula engine.

🎬 https://youtu.be/U81X4EWL_Us

📒 https://sudipta-deb.in/2024/06/evaluate-dynamic-formulas-in-apex.html

 

[▶️]🔴🔥🎬 Evaluate Dynamic Formulas In Apex “Evaluate Dynamic Formulas in Apex” is a new feature in Salesforce scheduled for release with Summer ’24 (currently in beta).

@The Blog Group

 

#SOQL Queries #New Releases #Release Readiness #Formulas@* Release Readiness Trailblazers *

0/9000

Hello awesome admins,

I am trying to use data loader to identify profiles (not permission sets) that have view or edit access to a field. This is my data loader query so far:

SELECT Field, Id, ParentId, PermissionsEdit, PermissionsRead

FROM FieldPermissions

WHERE

    SobjectType = 'Opportunity'

    AND Field = 'Opportunity.Special__c'

    AND (PermissionsEdit = True

    OR PermissionsRead = true)

 

I would like the export to include the Profile Name. Also, my goal is to use the export to then update some of the Profiles so that PermissionsEdit and PermissionsRead = False.

1. How do I include Profile Name in my query?

2. When I do the Update, which object should I be updating... is it the FieldPermissions object again?

Thank you!

#AwesomeAdmins #Dataloader #SOQL Queries

2 answers
0/9000

I am write a query to pull data from a custom object called Interaction Activity. Here is the query I have so far:

 

SELECT Id, Name, ContactId__c, Call_Type__c FROM Interaction_Activity__c Where Name includes 'INBOUND' AND Call_Type__c = 'OUTBOUND'

 

This issue I am running into so far, is that Name is not a picklist field and includes/excludes operator only works for picklists. What operator will work for text fields? Contains?

 

#SOQL Queries

2 answers
0/9000

Can you write me SOQL to fetch fourth highest annual revenue account whose name starts with C and it must be modified within 10 days

#SOQL Queries

1 answer
0/9000