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
1answer
23 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
31 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
16 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
61 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
39 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
44 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 ...
0
votes
0answers
11 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
59 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
32 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
40 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?
0
votes
0answers
15 views

Fields not updated after an Append query

I added new fields into a Data Extension used for historical purposes (updated in an Append way through a SQL query in an Automation) but, after adding the fields also in the query to append the new ...
1
vote
2answers
45 views

Finding a query from the DE

I am looking through journeys I didn't build, and I am trying to understand who we are sending the emails to. I can see that we are using entry event with a DE. When I go to that DE, I can't tell what ...
0
votes
1answer
41 views

How to eliminate bot clicks with query in Marketing Cloud?

we are querying several data views such as the click of specified links (via web collect) and email opens and email clicks. In the target Data Extensions that stores all (unique) clicks we experienced ...
1
vote
1answer
45 views

multiPicklist query

I have a few global picklists which I using for multi picklists. I'm trying to retrieve a data via SOQL but something goes wrong - not all the rows are back or sometimes none of them. It depends if I ...
3
votes
2answers
204 views

Can I define two primary keys in a database table & why?

In relational databases we can only define one primary key. Is it possible to define two primary keys, probably one is primary and other is secondary key and can be joined on any of the two fields.
0
votes
3answers
88 views

SOQL with Date filter in WHERE clause [duplicate]

@AuraEnabled public static List<StaffReport__c> getUserReports(String UserId, Date startDate, Date endDate) { return [Select Date__c from StaffReport__c where User__c =: UserId AND Date__c &...
0
votes
1answer
37 views

I am unable to query pricebook entry. (Internal Salesforce Error)

I am making a lightning component for a user to create a quote + line items quick and easy. However the apex function that is meant to query the pricebook entry and its Id for each line item is ...
0
votes
2answers
61 views

How to get all records from Report using JSforce NodeJS

I am trying to get all records from a specific Report. I am using NodeJS and the library JSforce. I have tried using the following code: var report = conn.analytics.report(reportId); report.execute({...
0
votes
2answers
34 views

Query with configurable column as where condition

I am trying to write a SQL query in automation studio but one column in where clause should be variable or configurable. Means, we should not hard code the value for a particular column and we should ...
2
votes
1answer
121 views

How to retrieve the correct Account records from SOQL query?

In account record I have a custom myDate__c field of type date. I need to retrieve all Account records where myDate__c is older than 45 days. I've tried with the following query: SELECT id, name ...
0
votes
1answer
23 views

SOQL Request / data model

This is my data model : I would like to get list of Classes(Class) with class category (Product_Category__c.Name) ,price (PricebookEntry.UnitPrice) and some fieds of the Class. What I've done : ...
0
votes
1answer
31 views

Jsforce where clause having multiple conditions not working

This below code results in INVALID_FIELD: Test' AND ParentId = null AND EndDate > '2019-05-21' LIMIT 1 error.. How can I add more than one condition in where clasue? const a = 2019-01-03 const b = ...
3
votes
1answer
77 views

Why is the Developer Console Query Results Preview only showing 8 records when the Total Rows count is 258?

I wrote a query in the Developer Console, and when I ran it, at the top of the screen it shows "Query Results - Total Rows: 258". Below that, in the preview panel, it only shows 8 records. I know ...
0
votes
0answers
25 views

What are the ways in which access to a field by query can be changed?

On a visualforce page with a controller, users could previously search on a custom contact field via SOSL. A few weeks ago, something changed and users get no results back in the search as if they ...
2
votes
1answer
112 views

SOQL Profile Id Bug Introduced in Summer 2019 Release

We have discovered SOQL Profile Id Bug Introduced in Summer 2019 Release. To reproduce this, we need to have either a Custom Object or Custom metadata with Custom Field of Text field which contains ...
1
vote
1answer
43 views

Querying for Content Views

in Marketing Cloud, I try to query for contacts who clicked on a specific link on a website and is hence stored in Content Views Data Extension. We want to use that for a kind of scoring, however ...
1
vote
1answer
41 views

Sub query result is 0

I want to get the Opportunity Ids of the Opportunity records that have associated OpportunityLineItems but no Revenue_Pipeline__c custom object records for a batch class. I have my sub-query which ...
-2
votes
1answer
88 views

Query more than 50000 records in a normal class

I need to query more than 50000 records and store it in a List variable. i know there is a governor limit which prevents it. please let me know if this can be accomplished without going for a batch ...
0
votes
1answer
30 views

Wrong format of JSON Array after a successful POST using Apex Class

I've been trying to create a List from the Account object, filtered by their record type, to be sent to our website using the Apex Class. I managed to create the query correctly and it returned the ...
0
votes
1answer
84 views

escapeSingleQuotes does not work on an array of string

I have a array of string and its values contains single quotes in it and i need to use this string array in a SOQL query. for example, consider the string array as EventName and the query is as below,...
-2
votes
2answers
64 views

How to use multiple set condition in better way in soql query

Is it possible to make query dynamic.I have sets like this: if(SetOfParentId.size()>0 || Set1.size()>0 || SetOfGSSDuplicateCase.size()>0 || SetOfLegacyDuplicateOfCase.size()>0 ||Set11....
3
votes
1answer
110 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
90 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
47 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
40 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 ...
2
votes
1answer
37 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
46 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
13 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
36 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
32 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
107 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
38 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
35 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
49 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
40 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
48 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
22 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
80 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 ...
2
votes
1answer
54 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
41 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?