Questions tagged [query]

A query is an inquiry into the database using the SELECT statement. A query is used to extract data from the database in a readable format according to the user's request.

Filter by
Sorted by
Tagged with
0
votes
0answers
19 views

First Order Date - SQL Query [on hold]

We are pushing through all of our past and future purchase information to a data extension and I was wondering if there is a sql query we could run to find a customers first order date a customer made....
1
vote
2answers
59 views

Query Data Extension with Left Join

I have one data extension that is about 9 million records (IGO 3 months simple). It has 2 columns, SKU and CustomerID. Both of the fields are NULL so there is duplicated CustomerID's and SKU's. I'm ...
0
votes
1answer
29 views

What query is causing error: “List has no rows for assignment to SObject”

The error occurs when loading the page for a custom object. My understanding is that this error means a query did not return any results, but I don't know how to begin identifying what query that is....
0
votes
3answers
58 views

Query did not opens in the past 180 days

I have the following query to find all subscribers that have not opened in the past 180 days: Target Data extension has: SUBSCRIBER RELATIONSHIP ContactKey relates to Subscribers on Subscriber Key ...
0
votes
1answer
26 views

Multiple Objects - Conga SOQL

So I have my Conga Invoice button on my Opportunity have a query of Select a,b,c from OpportunityLineItem where Opp.id. But I also need to get the other info from Custom Object(Property) This property ...
1
vote
1answer
30 views

SOSL query on Lightning Knowledge Articles returns only 250 records even if there are more than 2000+ matching records

Below query returns 250 records FIND {*test*} IN ALL FIELDS RETURNING Knowledge__kav(Id, Title WHERE PublishStatus='online' AND Language= 'en_US') Below query returns 2000 records FIND {*test*} IN ...
0
votes
0answers
30 views

Does indexing a custom field in the below scenario will help with Non-Selective query error?

Background : I have a object(Foo__c) with two columns(Value__c, Type__c). Type__c is a picklist, with two options(A and B) and Value__c is a text field. Running into Non-Selective query error when ...
0
votes
1answer
45 views

How to create a nested query that fetches opportunities, Content Document and Content Version [duplicate]

I am trying to fetch all files that are associated with the opportunities in 'XYZ' stage. I am trying to construct one nested query that would first fetch all the opportunities in that stage, then ...
1
vote
1answer
47 views

Edit Permissions for Guest Users after “Secure guest user record access”

Salesforce Alerted me that at the end of February we would be forced into the security update for "Secure guest user record access". I tried this in my sandbox and it seems to have some adverse ...
1
vote
1answer
33 views

Find Subscriberkey based on Subscriber ID

I have a daily file with only Subscriber IDs sent from Audience Studio into Salesforce Marketing Cloud. I have imported the file into a data extension called 'SubscriberID'. I will need to find the ...
2
votes
1answer
41 views

SOSL not returning all expected results

I'm trying to SOSL search a custom object we have, by a phone number field but the results are not working as I'd expect. The issue seems to be around missing characters at the start of the search ...
0
votes
1answer
60 views

Can you query two levels up in a hierarchy?

Hard to explain, but we have opportunities of many different types. I need to only get opportunities of a specific type, which i have done. Now I need to only get projects that have opportunities of ...
0
votes
2answers
49 views

We have a SQL Query looking for _Open and _Click data that is failing because it keeps timing out

The query is intended to populate LastClick and LastOpen data in our Master Subscribers DE. Here is the query: SELECT a.Email, a.LeadUID, MAX(o.EventDate) as LastOpenDate, MAX(c.EventDate) as ...
4
votes
1answer
52 views

SOSL Doesn't find data with wildcards

I'm working on a query to find some duplicate records by name. I take the name and replace anything thats not a letter with a wildcard. I wind up with a query that looks like this: FIND {Name*Name*} ...
0
votes
0answers
24 views

Can we query all processbuilder exist in system for an object. I am creating a document for a team

Is there any way I can export or query any process builder exist for particular objects from Org. I am creating a documentation for a quite complex org where there are many process builder each object....
0
votes
1answer
75 views

Database.Query does not return fields with null value

Hi i'm executing this query using Database.Query(query) Where query is SELECT field1__c, field2__c, field3__c FROM Object1__c On the current record, field3__c is NULL but when i query on the ...
2
votes
2answers
111 views

How to query field names from custom object by data type?

I have custom object ExchangeRate__c. How to get all fields, which have data type "currency" and put their field names in a string?
0
votes
2answers
65 views

Salesforce Data as Entry Event - System Generated Data Extension is not getting updated

I have a journey that is using Salesforce Data as the entry event. SFMC automatically creates a data extension for that journey and automatically links it in Data Designer in the Sales and Service ...
0
votes
0answers
34 views

Batch Apex Class quey

I am new to Salesforce and Apex language. So I have a use-case where I have to first make two custom objects named Aggregate Book of Records with fields year(type picklist with values from 2019-2025),...
1
vote
1answer
36 views

Why am I getting a path instead of a file when I query for VersionData on ContentVersion?

When I query for VersionData from a ContentVersion record, I get "/services/data/v44.0/sobjects/ContentVersion/0681F000000QY0eQAG/VersionData" in the response. I'm expecting a base64 encoded file. ...
0
votes
0answers
35 views

Can someone help me with a query

I am sending an outgoing SMS message to customers three hours before an appointment, my test contact is flowing through the entire journey properly but I'm not getting the text for this journey. I ...
1
vote
0answers
26 views

How to get list of all sobject records modified today in the system? [duplicate]

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this? Please reply.
1
vote
1answer
56 views

How to get list of all sobject records modified today in the system?

I need a list of all sobject records that got modified today. this is not just for one object but for all objects in the system. Is there a simpler way to do this?
0
votes
1answer
79 views

Date format in SQL query

We need a specific format date to personalize our emails, for example, the US date format is MM/DD/YYYY HH:MM:SS and we need to display DD/MM/YYYY. Is it possible to change the date format directly ...
5
votes
1answer
35 views

Query results from two list related to each other

Suppose I have in my org those Contact records: 1) FirstName = 'Ross', LastName = 'Geller' 2) FirstName = 'Rachel', LastName = 'Green' 3) FirstName = 'Monica', LastName = 'Geller' 4) FirstName = '...
-1
votes
1answer
104 views

Callback method isn't executing

My callback method isn't executing when trying to run multiple helper functions in a single controller method. -----------------------------------------------------------------Solved-----------------...
2
votes
1answer
30 views

PARENT CHILD SOQL

I have this query which is working but is it possible to only return a list of Accounts where company__c exists. SELECT ID, name, (select company__c from VotingRelatedCompanies__r where ...
0
votes
1answer
20 views

How can I filter a query with the results of a list?

I want to search properties only from this one list, "HIP Prospects". If the name searched is in this list I want it to be returned. How can i achieve this? Apex: public static List <...
0
votes
2answers
32 views

Lightning page with 4 buttons that invoke 4 different queries but only 1 displays at a time on the same visualforce page

I want to be able to run 4 different queries on a single visualforce page depending on the button clicked on a lightning component. Right now the way its set up works but it can't access the static ...
0
votes
0answers
36 views

Get the most recent open date through an SQL query

I have trouble with my query to get the most recent email open date. This is my query: Select distinct (SubscriberKey),EmailAddress, max(OpenTime) as OpenTime from unique_opens2 WHERE OpenTime > ...
0
votes
1answer
40 views

Ampersand character as value in data extension

Is it possible to have '&' character as an attribute value in the data extension? I am using SQL Query activity to insert the value. Or is there a better way then my current SQL code. I've ...
0
votes
2answers
40 views

Returning wrong order in SOQL ORDER BY

I'm facing a problem with the SOQL ORDER BY. I'm quering on a custom object with this query SELECT completeTreeSequence__c FROM CPQ_Line__c WHERE CPQ_Header_RU__r.Id = 'a043E000005PfD7QAK' ORDER ...
1
vote
1answer
42 views

Trigger for loop and SOQL limits

I have a trigger. It inserts imported Gears with correct fields' values. One of valu I took from Detail__c - related to MoreInfo__c object. And Tool__c is related to MoreInfo__c too. Each MoreInfo__c ...
1
vote
1answer
38 views

Help with NOT in SOQL [duplicate]

I'm trying to query for records that do not contain LTD or LLP in the name and are also not assigned to a certain record type. I have tried just about every variation with parenthesis and AND/OR ...
1
vote
2answers
44 views

How to separate Visualforce table by a value?

I'm trying to separate my Visualforce table by Hummer's Id value: public List<Hammer__c> getHummers() { return [SELECT Id, Name FROM Hammer__c]; } public List<Factory__c> ...
-1
votes
1answer
32 views

How to avoid limits in Trigger's SOQL?

I have a trigger. And if it's an import of many records I get an error becouse SOQL Limit is 101 records: trigger GearCreationTrigger on Tool__c (after insert) { List<Gear__c> toInsert = ...
3
votes
1answer
54 views

Print reason for SQL query failing in SSJS

I built a Microsite which staff can you use to run one-off queries without having to create an activity and then run it or place it in an automation. It works great but is very basic - when you click ...
1
vote
2answers
288 views

The 50,000 row query limit is not actually a “per APEX call” as widely believed

I recently ran into a strange issue with the 50,000 row query limit that had me puzzled due to the belief that the 50,000 row query limit applied only per-call. This realization occurred while ...
0
votes
1answer
23 views

Can't query newly created field after deploying change set (works in sandbox)

I created a field 'Legal_Records_Parent_Box_Folder_Id__c' in a sandbox for the Account object, deployed the field to production, with a few scripts where the field was referenced. When I query the ...
0
votes
2answers
103 views

Is it possible to query the Apex Class Accesses of a permission set?

I'm not sure about the object name and the Field Name. I tried but i think "ApexClass" is not the right object to call apexclass from a permission set. Here is the query [Select Id, Name From ...
0
votes
1answer
53 views

Querying custom object's lookups' lookup

Goal : To parse Record data into Conga output document from a base object's lookup field to a custom object that looks Objects: SBQQ__Quote__c (Base) Project_Reference__c (Custom Object attached to ...
1
vote
1answer
41 views

SOQL - Get results in same order as in query

How can I get results for query on same order as listed on query itself. Example: (Let's suppose all records with that BackendId__c exist) SELECT BackendId__c, Name, id FROM Account WHERE ...
0
votes
0answers
18 views

Get last automation activities

I bumped into an issue with getting the data of automation activities: In the Automation Studio there is the Activity tab with "Run Log". How I can get the data of Start/Completed time for the list of ...
5
votes
1answer
68 views

Is there a reliable way to know which SObjects are supported by a SOSL search?

Having some trouble as an ISV with dynamic SOSL. I have a search box that searches all records. When building the SOSL query, I only add objects that have the IsSearchable flag set to true on the ...
1
vote
1answer
81 views

Deleting rows from a Data Extension without having to copy the entire table to a temp table

On a daily basis, I have to remove some rows from my Customers Data Extension. This cannot be done via the Data Retention Policy since the IDs are provided by a database (and saved in a separate Data ...
0
votes
0answers
48 views

any way to reduce long query in Apex class

I have below query which is checking profile permissions .is there any way if this query can be shortened..like using custom label in SOQL or Custom Setting [SELECT profile.name FROM Profile where ...
1
vote
0answers
16 views

How to query the Lightning Sync Error records

Once Lightning Sync is enabled a new report type can be created, selecting LightningSyncError as the primary object. I would need to query this object in order to get the list of sync errors through ...
0
votes
1answer
81 views

SQL Join Within Same Data Extension, Surveys

I made a survey in the Sales Cloud that I am pulling into the Marketing Cloud using automation studio and the responses are saved in a data extension. However every question response appears as a ...
0
votes
1answer
38 views

Can we get all apex class that can be scheduled?

I want to create a query which gets for me the apex classes that we can schedule. I already know know the query to get all the apex class classes, but i only want the classes that can be scheduled.
1
vote
2answers
44 views

How to assign current date to a custom field in a apex controller

transact.Transaction_Date__c=Date.Today(); Above is my code. Why am i getting yesterdays date?