Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
18 views

What are “LOB fields” in an asset? Querying all the fields on the asset causes a limit exception, why?

First of all: what are LOB fields? Secondly: I have a complex apex automated process in which I need to make an exact copy of an Asset object (all of its fields). To do this I created a method that ...
1
vote
1answer
42 views

SQL Query Activity Data Extension Values are Case Sensitive

Are Data Extension values case sensitive when querying with SQL query activity? I found this to be the case when querying WHERE Status = 'Active' that it ignored records with a status value of "...
4
votes
2answers
29 views

How to find query that populated a marketing cloud data extention?

I am looking at a data extension that is appended to daily. Is there an easy way to find the query that is adding that data? There are too many folders for me to dig through to find the query with the ...
1
vote
1answer
29 views

Querying system data views only for parent account

Querying System data views and wanted to get results only for parent account. here parent account is acting like any other Business Unit. while query returns the results for all Business units. How ...
1
vote
1answer
30 views

SQL query not returning expected amount of subscribers

I've been trying variations of this SQL query: SELECT c.Id , c.Email , c.RecordTypeId , o.CreatedDate , o.Name , o.StageName as Stage , ca.Subject , ca.Status FROM Contact_Salesforce c JOIN ...
1
vote
1answer
33 views

SOQL and Indexes

I am trying to understand more about "SOQL Query Performance" topic and I'm reading all the Salesforce docs. I have a doubt when we have a WHERE clause with an AND condition. The two docs on this ...
1
vote
1answer
11 views

Query all subscribers that received specific amount of emails

I want to set a "limit" in terms of email sends, e.g. every contact that already received 3 mails within the last 3 days shall be excluded from a next mail. I tried with query but since it's not ...
0
votes
0answers
31 views

Order by (multi-select picklist value alphabetically) Order by LastModifiedDate

I am attempting to bring back a list of contacts per account, but I need the contacts with type of Billing to be returned before contacts of type Account Owner, then in addition to this I would like ...
0
votes
1answer
29 views

Query Still Pulling Records Even with Clear WHERE statement

I'm really confused / lost on this one. Writing a Query to select Opportunities not of Stage '6 - Closed Won' and it still pulls these records. This is happening with no other picklist values in the ...
0
votes
3answers
60 views

replace ' with \' in apex code

i have string variable called "Identifier" which has apostrophe in it. example: Identifier = "string's length" i need to replace this apostrophe with "\'" the result should be Identifier = "string\'...
4
votes
1answer
33 views

Will a Suppression List increase send time?

Background: I have a daily batch process that creates a sendable Data Extension from a query on a Synchronized Data Extension. The automation runs a query that overwrites the sendable Data Extension ...
0
votes
2answers
22 views

Getting a record's sibling records in SOQL with a single query

I've looked high and low and cannot find an answer to this question. Lets say I have a custom object called Appointment__c which is a child of the Case object, I have a VisualForce page that is ...
0
votes
1answer
19 views

Conga Composer: Query Salesforce Files from Products to Opportunity

A button on an opportunity should bring all salesforce files from the related products. Trying to figure out the correct query for this What i have found so far is the query for salesforce files: ...
0
votes
1answer
17 views

Query - Opportunities where last Stage change date is this calendar year

I am struggling to get a query constructed to Opportunities where last Stage change date is this calendar year. SELECT Actual_Decision_Year_DE__c, Decision_Outcome_Details__c, Delegate_Days_del__c, ...
2
votes
1answer
31 views

SFMC: Query Based Data Extension Help

We have a synchronized data extension from Sales Cloud coming into our SFMC instance. In the Opportunities table, it is possible for a single customer to have multiple Opportunities in various stages, ...
1
vote
1answer
20 views

Execute List of Queries

I have a list of id's i want to populate their name. This list contains account ids, contact ids, etc. Not only one sobjectType id. I created a map that the key is the sobjectType, and the value is ...
3
votes
3answers
74 views

Array notation for List<List<Sobject>>

In an attempt to be as byte pinching as possible(personal goal), I have a question some time on Google has not been able to answer. I did look at some Java documentation to try and resolve the issue ...
1
vote
1answer
34 views

Marketing cloud sql query execution error - Violation of PRIMARY KEY constraint

I'm getting following error during update activity. Query failed during execution. Error: Violation of PRIMARY KEY constraint. Cannot insert duplicate key in object 'Enq_opp_Parallel_ContactView'. The ...
0
votes
1answer
38 views

Retrieve all sends to a specific records in Marketing Cloud [closed]

How the query shall look like if we want to retrieve all emails a specific contact received?
0
votes
1answer
16 views

JS Query variable binding

Trying to transfer an apex query to Javascript. Wondering if binding works in the same manner? Also is using result.length valid for the if statement? var accLike = '%' + 'Construction' + '%'; var ...
1
vote
2answers
27 views

Query parsing error like clause

What is the correct syntax for a query that retrieves all Accounts that have __Civil_ in the Name? SELECT Id FROM Account WHERE (Name LIKE '%_Civil_%')
0
votes
0answers
27 views

SOSL Returning 0 Results For Custom Setting Objects

We have been using SOSL to query a list of countries defined as a custom setting which was working fine until recently. I have also tried SOSL on other custom setting objects and getting 0 results as ...
2
votes
1answer
43 views

DX CLI force:data:tree:export Query returned no results

Records are returned when I execute this sfdx force:data:soql:query -u Dev --json --query "SELECT Id, Name, (SELECT Id, Name, AccountId FROM Contacts) FROM Account WHERE Id IN ('0010z00001T1uXSAAZ','...
1
vote
2answers
103 views

How do I use this column in a SOQL join?

I'm trying to write a JOIN in SOQL. But having some problems. I have a column PLWorkshopProduct__c in my table that links to another table, Product2. I tried writing the below .. Select ID FROM ...
-2
votes
1answer
41 views

How to send email through apex in salesforce? [closed]

public static AggregateResult[] Get_Officer() { Date startDate = Date.today().addMonths(-1); startDate = Date.newInstance(startDate.year(),startDate.month(),1); Date endDate = ...
0
votes
1answer
34 views

Retrieving Owner.Name from List of objects [duplicate]

I am trying to retrieve the following fields Owner.Name, Name, Id from ActionPlanTemplate object and returning a list. However, when the list is returned, I do not get Owner.Name in the ...
1
vote
1answer
49 views

Promise function in WireMethod not working properly

I am writing this wire method that when the data is loaded, it will trigger off a refresh of some other wire methods dependent on the results of this wire method. I do this by using a Promise and ...
0
votes
0answers
38 views

Construct a JSON Object from many queries in Javascript Web Component

I am building a web component and would like to build a nested JSON structure in JS through multiple queries to use in my html. How would I go about this? My schema includes an object called ...
0
votes
2answers
20 views

How can I use a SOQL query to get the number of AccountTeamMembers on an account?

I can write something like this to give me the AccountTeamMembers on all accounts select Id, (SELECT Id, AccountId FROM AccountTeamMembers) From Account but I don't know how to just get the count of ...
0
votes
0answers
22 views

Journey Query showing error: An unmatched parenthesis occurs in the query

I have this following query to extract click information on Journey and its ema : select j.JourneyName, j.VersionNumber, ja.ActivityName as 'EmailName', s.EventDate as 'ClickTime', su.EmailAddress, ...
-4
votes
3answers
66 views

how to create dynamic query [closed]

List<Opportunity> opps = [ SELECT Id ,Name ,Amount ,CloseDate ,Stagename ,Near_to_Close_Date__c ...
0
votes
2answers
39 views

No results when querying _Click data view in Marketing Cloud

I'm trying to query the _Click data view and return a SubscriberKey for every user that clicked a link in a particular email. I've try several different ways to get at this and none are returning any ...
1
vote
2answers
36 views

Got error while constructing the dynamic query

I was trying to build a query to pass it in the QueryLocator. The following is the code snippet I tried to generate the dynamic query, public String buildQueryString(Object_Rule__mdt ObjectRule, ...
0
votes
1answer
22 views

Write to LIST from a DATA EXTENSION

I am trying to pull subscriber information from a Data Extension, and then add it into a custom list. I understand that the ideal process is to create a data extract, then import the CSV into the ...
6
votes
2answers
221 views

Not all records returned in SOQL Query

I have a query that I'm using to export data: SELECT c.Id, c.SystemModstamp, ... FROM Contact c WHERE c.SystemModstamp > start AND c.SystemModstamp < end AND c.Id > string ORDER BY c.Id ASC ...
0
votes
1answer
59 views

Too Many SOQL Queries error

I am coming into this problem in my debug logs. But when I'm reviewing the logs I am only seeing individual reads of SOQL query counts from various apps such as : Number of SOQL queries: 5 out of ...
1
vote
1answer
79 views

I am querying more than 2000 records. Is it a good idea to use the BULK API?

I'm new to the Salesforce community, so I apologize if this question is asked wrong. I was running into essentially the exact same problem mentioned in this post. Basically, I have a query that ...
1
vote
3answers
76 views

SQL multiple WHERE clause problem

I have a SQL query that puts records from one DE to another DE if that record does not exists in the second DE. The base works fine for me and i have the following query: select t.Emailaddress from [...
0
votes
1answer
54 views

Is it possible to write a SQL Query to extract send data that includes Tags and/or Campaign names

We are trying to do some reporting based on emails with specific tags or associated to specific campaigns over the past 12 months. I have tired to use the Analytics builder > Reports to get the data ...
0
votes
0answers
12 views

Trying to query the _open and click tables to fill a new table with the email of the users who have opened or clicked a link in an email

I'd like a query to pull from a specific email which is in content builder. What would my query look like? Also what columns are needed for the target Data Extension?
1
vote
1answer
20 views

Pulling every email job an email address has ever received

I am looking to pull all the email jobs that a particular email address has received. The issue is our transactional unit uses email as a the subscriber key and our promotional unit uses unique ...
0
votes
1answer
23 views

How does joining two custom objects into one custom object through master-detail relationship work

I've been working on a test method but I've had a problem creating the setup of it. public static List<Job_Posting__c> createPostings(){ List<Job_Posting__c> testPostings = new ...
0
votes
1answer
39 views

How to add 'LIMIT :' to String in Database.query?

I have Database.query that sorts records by a few filters (or any filter). I want to set the limit for it. How should a write it? return Database.query('SELECT Id, Name FROM Stereo_System__c' + ...
0
votes
0answers
11 views

Query using Click Data View to update a Data Extension

Currently I'm trying to create a query that will update a data extension field based on clicks on a series of emails (that go to the same url) My success agent suggested using the Click Data View, ...
0
votes
0answers
23 views

Update Journey Builder Entry Event by querying Decision Split data [closed]

I want to query the contact that went down a specific path in a decision split and get all of those contacts so that I can take them out of the entry event that fire's a journey builder. I will need ...
1
vote
1answer
57 views

Notes & Attachments Cant find using soql

I did not get any result from querying notes and attachment. Setup I create a custom object. I added notes and attachment to the custom object I created soql that filter by parentId and it looks like ...
0
votes
1answer
124 views

Malformed Query

UPDATE: Changed query from dynamic to static. Still have malformed problem. I have a malformed query problem. Could somebody help? It works in my batch class, but not my normal class. [...
1
vote
2answers
112 views

Select Knowledge object in SOQL query

I'm trying to get all articles which are published and online. In my user I turned on all permission set and so one to have access to Knowledge. List<Knowledge__kav> myList= [SELECT Id, ...
0
votes
0answers
9 views

Not able to query the data from heroku

I have imported my salesforce contact object data to heroku using heroku connect. I have also used heroku postgres addon for database. I have done this in php and have deployed the app to heroku ...
0
votes
1answer
32 views

Can I query Salesforce Queue and can I do it using the metadata or tooling APIs?

Can I query Salesforce Queue and can I do it using the metadata or tooling APIs? Looking to quickly access this data from Salesforce inspector, also looking to see if there is a way to check if a ...