Skip to main content

#SOQL Queries0 discussing

Reports to SOQL in “one click”? 

 

Ever had a user come to you with a report and say:

“Hey… I might have messed up all these accounts. Can you mass update them?” 

 

Then you open the report and realize:

  • it’s a joined report
  • built on custom report types
  • random field relationships
  • unclear naming everywhere

(Iam a Drama queen)

 

 

…and now you’re reverse-engineering the whole thing just to figure out what data you’re even looking at. 

 

That process takes time. And honestly, it’s just unnecessary mental load.

 

So… "we" built something 😶‍🌫️

A Lightning-based Report → SOQL Builder

You enter a report name or ID, and it generates the closest safe SOQL version of that report.

 

What it does:

  • Search reports by name or ID
  • Generate best-effort SOQL
  • Translate supported columns & filters
  • Flag anything unclear or unsupported
  • Reuse verified mappings via an internal registry

Important:

 

It doesn’t guess. If something can’t be mapped safely, it gets flagged instead of being faked.

 

Why I’m posting:

I’ve tested this in our own environment, but Salesforce orgs are messy in very creative ways:

  • custom report types
  • naming inconsistencies
  • weird relationships
  • complex filters

Now we want to test it against real-world setups.

Looking for:

  • 2–5 Salesforce admins / power users
  • sandbox or test org (you’ll get the component, type in a few reports, and share feedback/screenshots)
  • or a short screenshare session

What I need from you:

  • honest feedback
  • where the SOQL helps
  • where it breaks or feels unclear

What I don’t need:

  • production access
  • long commitments
  • perfectly structured orgs (those don’t exist anyway :P )

 

It´s Just a prototype, I want to harden with real feedback before deciding where to take it.

If you’re interested, comment or dem me.

Would especially love input from people working with:

  • custom report types
  • relationship-heavy reports
  • complex filters
  • reporting-heavy workflows

Thanks 🙏 

 

 

Reports to SOQL in “one click”? Ever had a user come to you with a report and say:“Hey… I might have messed up all these accounts. Can you mass update them?

 

 

 

 

#SOQL Queries

0/9000
Lex Somers asked in Conga

I am new to salesforce / conga, so apologies if I use incorrect terminology. 

 

I am attempting update a conga template by adding some extra merge fields that utilize Conga queries and the Conga solution UI to automatically fill in some values. My problem is that when I generate the document using a custom action button on one of our record pages, the merge fields I just added are not filing in, so it leaves a blank space where the values should be. There are other merge fields on the document that work correctly, its just the new ones I tried adding that are not populating on the generated document. 

 

Here is the conga button I'm using (some Ids and names have been changed for privacy):

/apex/APXTConga4__Conga_Composer?SolMgr=1&serverUrl={!API.Partner_Server_URL_520}&Id={!SCMC__Purchase_Order__c.Id}&QueryId=[PurchaseProject]0Q_XXXXXXXXXXXX,[SSA]0Q_XXXXXXXXXXXX%3Fpv0%3D{!SCMC__Purchase_Order__c.Id}~pv1%3DContract,[InitialPayment]0Q_XXXXXXXXXXXX%3Fpv0%3D{!SCMC__Purchase_Order__c.Id},[FinalPayment]0Q_XXXXXXXXXXXX%3Fpv0%3D{!SCMC__Purchase_Order__c.Id},[SecondPayment]0Q_XXXXXXXXXXXX%3Fpv0%3D{!SCMC__Purchase_Order__c.Id}&TemplateId=0T_117UAM183313&SC0=1&SC1=SalesforceFile&OFN=Contract_{!SCMC__Purchase_Order__c.Name}&RM=1&datatagenable=1&DS7=11

 

And here is the query:

SELECT SCMC__Unit_Cost__c FROM SCMC__Purchase_Order_Line_Item__c WHERE SCMC__Purchase_Order__c = '{pv0}' AND SCMC__Line_Number__c = '1' LIMIT 1

And in the Conga solution UI, I added pv0 = {!SCMC__Purchase_Order__c.Id} 

 

Finally, in my conga template, I'm trying to access the value of that query with this syntax but nothing ends up showing when I generate the document:

{{InitialPayment.SCMC__Unit_Cost__c}}

 

Did I set something up wrong or am I using the incorrect syntax, etc? Any advice would be appreciated.  

 

Also, another issue I'm having is I'm trying to use a merge field to access a field on the Master object (Master object type is 'SCMC__Purchase_Order__c' using this syntax:

{{Master.SCMC__Total_Value_of_PO__c}}

But again, this value is not populating when I generate the doc.  

 

And as a general note, I know for a fact that these values do exist on the relevant objects. I have the record pulled up and am looking at the fields and the corresponding values. 

 

#Conga Composer

 

#Salesforce Developer

 

#SOQL Queries

1 answer
  1. Jan 28, 3:49 PM

    check the conga quiries, normally when this used to happen I open it in the conga composer and make sure that I can see the fields there and just copy and paste

0/9000

Hello, Enhanced Notes attached to Accounts are widely used in our org. I am trying to create a report to show all recently created notes. When I use a 'File and Content' report, I am only able to view notes that I own or were shared with me and also are not related to an object. When the note is related to an object, the note no longer shows on my report. If it is not possible to create a report showing recently created noters related to accounts, then I was thinking of creating a custom object to store notes going forward. Is there a way to export all ContentNote details with the related object Ids?  

 

#SOQL Queries

1 answer
  1. Steven Trumble (Strum Consulting) Forum Ambassador
    Oct 31, 2025, 2:24 AM

    Make sure you have this setting enabled. https://help.salesforce.com/s/articleView?id=000395050&type=1

     

     

    If you use set up's Data Export you should also be able to retrive the details you need

0/9000

I need to write a SOQL Query for Remote Site Details that includes the Disable Protocol Security field. 

 

I know SF is getting away from Work Bench, but I would be using workbench to run the Query. 

 

#SOQL Queries 

1 answer
  1. Oct 1, 2025, 10:14 AM

    Hi @David Vowels

    ,  

    Thank you for reaching out to the community.   

      

    This is not directly possible through SOQL unfortunately. This is a metadata which is fetched through tooling api, so in order to access through code we have limitation because we will receive the entire metadata as object of objects & the metadata field itself holds multiple properties in which one among them is your 'Disable Protocol Security' field. 

      

    So, I recommend you to please use the following script to get the details: 

     

    HttpRequest req = new HttpRequest(); 

    req.setEndpoint('replace_this_with_your_org_my_domain_URL/services/data/v60.0/tooling/query/?q=SELECT+Id,SiteName,Metadata+FROM+RemoteProxy+WHERE+SiteName=\'Replace_this_with_your_remote_site_setting_name\''); 

    req.setMethod('GET'); 

    req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId()); 

    req.setHeader('Content-Type', 'application/json'); 

     

    Http http = new Http(); 

    HttpResponse res = http.send(req); 

     

    if (res.getStatusCode() == 200) { 

        Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(res.getBody()); 

        List<Object> records = (List<Object>) results.get('records'); 

         

        if (!records.isEmpty()) { 

            Map<String, Object> record = (Map<String, Object>) records[0]; 

            // The Metadata is a nested map of key-value pairs. 

            Map<String, Object> metadata = (Map<String, Object>) record.get('Metadata'); 

             

            System.debug('Site Name: ' + record.get('SiteName')); 

            System.debug('Endpoint URL: ' + metadata.get('url')); 

            System.debug('Disable Protocol Security: ' + metadata.get('disableProtocolSecurity')); 

        } 

     

    Because we can't access  Disable Protocol Security field directly due to metadata hierarchy this is the only way left to get your desired property value for that field. 

     

    Please feel free to let me know if you need any more help with this.  

      

    Please mark this as the best answer if it solves your issue. This will help the community consider this a reference and avoid creating multiple questions on the same concept.   

      

    Have a great day ahead!  

      

    Thanks & Regards  

    Nagarjuna 

0/9000

Hi, I have Asset record related to two seperate account records. I am trying to get some information from the custom relationship to the second account record. When I simply write this query 

SELECT Name, AccountId, Account.name, Account.name.phone FROM Asset  I get the Primary account result. not sure how can I query the second account information 

7 answers
  1. Manoj Nambirajan (Dell Technologies) Forum Ambassador
    Sep 25, 2021, 12:53 AM

    yes. Thats how cross reference formula are written.. its __r.. to refer

     

    Help Mark best answer to help other trailblazers.

0/9000

I want fetch Contact Record IDs (PersonContactID) to match the Person Account IDs. How can I get it using SOQL? 

 

#Data Management  #SOQL Queries

8 answers
  1. Jun 16, 2025, 11:14 AM

    You can get the Contact IDs tied to Person Accounts like this: 

    SELECT Id, PersonContactId FROM Account WHERE IsPersonAccount = TRUE 

     

    Each Person Account has a hidden link to its Contact via PersonContactId. Just filter by IsPersonAccount = TRUE and you're good.

0/9000

I am using SOQL to attempt to see which profiles can Reset Passwords. 

I am using this SOQL but keep getting error messages in Workbench --  

SELECT Id, Name, PermissionsModifyAllData, PermissionsResetPassword, PermissionsUnlockUsers 

FROM Profile 

WHERE PermissionsResetPassword = TRUE AND PermissionsUnlockUsers = TRUE 

 

Can someone please suggest the correct SOQL so I can pull this data. 

 

#SOQL Queries #Salesforce Developer 

4 answers
  1. Apr 24, 2025, 12:04 AM

    Try using just this

    SELECT Id, Name, PermissionsModifyAllData, PermissionsResetPasswords FROM Profile
0/9000

I ran a soql query in Workbench and saved results as CSV. Worked great when I only had 2 where clauses, and it did not work when I had 3 where clauses. 

 

I have never set up my VS Code. I have 2 questions before I set up VS Code. 

1. Can I run SOQL with 3 where clauses in VS Code? 

2. Can you export SOQL results from VS Code into a CSV?  

 

#Salesforce Developer #SOQL Queries #Salesforce Developers @* Salesforce Administrators *

4 answers
  1. Apr 17, 2025, 3:12 PM

    Could you copy in your SOQL to get a look at what you are trying to do?  Might help with feedback.

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

3 answers
0/9000

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