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
10 views

Error when deserealizing reply message from 'query' operation in .NET Core 3.1

I'm encountering the following error when using the query operation from the Salesforce SoapClient System.ServiceModel.CommunicationException: Error in deserializing body of reply message for ...
1
vote
1answer
32 views

Creating a log of all subscribers' most recent email. It's missing some people. SQL help?

For about 18 months I've been running an automation to keep a list of all subscribers and the date of their most recent email. I have two queries and two data extensions. Number 1 is: SELECT ...
0
votes
1answer
24 views

Multiple SQL statements in one Activity

We have to check in our transaction database to see if the product is bought. We get the data like: DB1 key product_1 Product_2 product_3 111 123456789 789456456 456789132 123 487462538 487454521 ...
0
votes
1answer
22 views

Query not working in MC

my query is not working, can you help me please? SELECT Id FROM DE_test1 WHERE Id="0032X00002NNlK7QAL" Error: Error saving the Query field.Incorrect syntax near 'X00002NNlK7QAL'.
0
votes
2answers
26 views

Query accounts having only closed lost opportunities

We are planning to reengage closed accounts after a certain amount of time. So, I'm trying to run a report to query accounts that have only closed lost opportunities. But I'm unable to query accounts ...
0
votes
0answers
35 views

How can I add to my list a manual field

How can I add to my list a manual field (oName), because I want to add the object name of the query. In other sql I can use syntax below. SELECT Id, Name, createdDate, 'value' as oName FROM TASK ...
1
vote
1answer
28 views

SFMC Dynamic Timezone Sends

Timezones are a concept I have a hard time wrapping my head around. I'm trying to build a dynamic timezone program that runs an adjusted sendtime on a daily basis. Everyone should be receiving an ...
0
votes
0answers
43 views

error while querying tooling api for FullName EVEN WHEN LIMITED TO ONE RESULT

I've been using the tooling API to query layouts and I need to access the metadata or FullName fields. I know I can only use this with a single row at a time, so I either loop over all layouts with a &...
0
votes
1answer
24 views

Concatenate data of different objects in one list

I want to create an overview of a list which contains content from different objects. I will try to add in this list the files, tasks, events, emails and notes. If I query for each object a list, how ...
-1
votes
1answer
18 views

How do I get records when Id's are in a text field of an object. These Id's are Ids of duplicate record and need to be eliminated using a flow

I am trying to extract IDs from a text field and trying to get records of the ID that are in the text field. Basically, the text field stores the IDs of duplicate records and only one of the records ...
0
votes
1answer
35 views

Soql query to retrieve data from three related object

I have three custom objects: Book, Loan, and Reader. Loan is a junction object with lookup relationship with both Book and Reader. The diagram below shows their relationship: I want to write a SOQL ...
0
votes
2answers
24 views

Problem with 'OR' on this SOQL?

SELECT Id, F1, F2, F3, F4 FROM Account WHERE F1 = false AND F2 IN :list OR ( F3 = '001' AND F4 = '002'); This query throws this error: System.QueryException: unexpected token: OR If I put AND, it ...
0
votes
1answer
41 views

Create a Master DE of Subscribers in a Child BU

Hangup: We have four separate "master DE's" being imported from IT into our marketing child business unit, each segmenting customers a different way. There is overlap between the four. Goal: ...
0
votes
0answers
36 views

Filter Knowledge Articles search results by Brand (WHERE Brand = …)

I'm making a custom Knowledge Search (it needs to be custom), and the basic query to search articles is 'SELECT Id, Title, Summary FROM Knowledge__kav WHERE Title LIKE \'%' + input + '%\''. This is in ...
0
votes
1answer
47 views

REQUEST_RUNNING_TOO_LONG :Your request was running for too long, and has been stopped

I have created a Batch which is supposed to pull Completed tasks and Reopen them. It's a simple implementation (code attached), but what i observe is the Query is taking too long and ultimately aborts ...
0
votes
1answer
38 views

Query data from different object

I have 2 custom objects. Let's name it to object 1 and object 2. Both of these objects have their own field. Object 1 have fields: Customer name, item, quantity, total, ..... object 2 have fields: ...
0
votes
0answers
35 views

How to get only active workflow rules

Tooling API help to get all workflow rules, But I need only active workflow rules. How to get the active property information. for all workflow rules (Including inactive ) /services/data/v36.0/tooling/...
7
votes
1answer
181 views

SOQL query to fetch records with reserved characters ('*', '/', '(', ')')

Hoping there is a simple answer that I am overlooking. Currently, we are able to search for the following reserved characters with an escape sequence, eg a backslash character '\', in SOSL: & | ! ...
1
vote
2answers
48 views

Joining SendLog and Click Data View does not return any results

I want pull out the list of customers that did not click on the mail we sent. We maintain a SendLog in which we have additional attributes logged (Example: emailname, subject etc.) I understand that ...
0
votes
1answer
22 views

Querying multiple tables when single field contains polymorphic Ids

I have a text field called "references" that holds Id's of Other objects. Now, I want to get records that are in "references" by searching all the objects. Map<Id, CustObj1__c&...
0
votes
0answers
24 views

Assistance with GROUP BY SOQL Query

I have created a Conga Composer SOQL query that takes a bundled product with recurring and non recurring items, sums them by charge type, and masks the child products with the bundle parent name and ...
2
votes
1answer
61 views

Bulk API v2 Query job not returning results in same order as that of SOQL

I am using Bulk API v2 Query job to query on data from Salesforce. For example my SOQL is - select id, firstname, lastname, city, state, country from account In the response I am expecting columns to ...
0
votes
0answers
28 views

Query for all subscribers AddMethod, DateModified, DateCreated for mismatched emails with subscriber key in SFMC?

I'm going to start by saying this forum has been nothing but helpful and appreciate everyone taking the time to respond to others. This is my first post so I apologize if this is not following the ...
0
votes
0answers
16 views

Error in query bindings

I wanted to create a new binding in order to be able to filter the table by Regions. Could you please help me with the query below? q = load "OpptyLineItems"; q = foreach q generate 'Id' as ...
0
votes
2answers
33 views

SOQL Query to extract certain attachments fails

I want to export attachments of those Owners who belong to a certain Organisation. I tried: SELECT BodyLength FROM Attachment WHERE OwnerId.Organisation_Name__r = 'ExampleCompanyName', but got the ...
1
vote
1answer
51 views

Querying based on user profile

I want to write queries to check what apps page layouts lightning components fields are accessible to a particular user profile for a particular object. I also want to find out whether the user ...
0
votes
0answers
34 views

Before-Save flow query limits

Since one of our main triggers has too many related processes, we are almost reaching the query limits. We have the idea to move some tasks executed in the before update context to a Before-save flow. ...
1
vote
2answers
37 views

How to run a report (or query) to get the number of (first) child records of a record?

Any way I can do this via report? or apex if not? Thanks for your help!
-1
votes
1answer
93 views

How to query two unrelated objects? [duplicate]

I want to query two unrelated objects, and I can't create a lookup relationship between them. They have the same global picklist sets in both of them and I want to query the records from one of the ...
0
votes
0answers
18 views

SOQL query filter by value of another column [duplicate]

I am trying to make an extremely simple query where I filter the result based on the result of two columns. Ex: SELECT x, y FROM coordinates WHERE x > y; So far I didn't found any example of how ...
1
vote
2answers
18 views

How to set default time in DE date field time using SQL in marketing cloud

whenever a record is created how to set the time in the Date field time value to 8AM by default. SELECT CustomerID, CreatedDate, DATEADD(Day, 1, CreatedDate) As NextDate from TestCustomers instead ...
0
votes
1answer
36 views

Errors: No column name was specified for column 2 of 'Qry'

I try to extract email duplicates from All Subscriber list of Marketing Cloud and I have a syntax error that I do not understand. select a.EmailAddress, COUNT(a.EmailAddress) from _ListSubscribers ...
0
votes
1answer
58 views

Fetch only one child record of a parent in soql

I have a requirement to fetch Timecard records that are related to a Project. Below is my query: List <Timecard__c> timecard = [ SELECT ID,Project__c,resource_name__c FROM Timecard__c ...
0
votes
2answers
31 views

lwc lookup component not returning what I search for

I found a lookup component that I am using and so far was ok until last week. The user would like to type a word and all products with that word will be displaying. example: when a user type CPC in ...
0
votes
1answer
41 views

Query cursor Question

Have a query regarding Query Cursor. There are two limits that I see for Maximum number of query cursors open concurrently per user in the limits cheatsheet doc. i) 50 for Apex Transactions. ii) 10 ...
0
votes
0answers
30 views

Why is SOQL query is returning deleted Opportunity split record

I have an Opportunity, under which I had initially added two Opportunity split records. But later I deleted one of the Split records among them using the delete button in the UI, as I didn't need it ...
0
votes
0answers
78 views

Get fields in REST response for 0 records found

I need to display fields to the user for query requests where there are 0 records found. So for example if I have SELECT id, status,subject,AccountID, Description , CreatedDate FROM Task I want to ...
-1
votes
3answers
32 views

How to convert of a object into string?

@isTest static void test_deleteAddOnApplicant1(){ Test.startTest(); List<Applicant__c> appid = [select id from Applicant__c limit 1 ]; String result = CF_ALL_Offers_CC....
0
votes
2answers
54 views

Help with SOQL inner and outer queries

I have a requirement to find total number of parent records which are not associated to any child records. Now these two parent and child records are from single object called Project__c. To achieve ...
2
votes
1answer
132 views

LWC's apex query returns more than 50k results, how to bypass this limitation?

Any idea for how can I bypass this 50k row limitation? Thanks for your help!
0
votes
1answer
51 views

How to retrieve opportunities and their partners via SOQL? [closed]

There's a report type that I can select "Opportunities with Partners". When created, it shows Opportunity, Partner, and Account information In SF there are two objects to represent this ...
0
votes
1answer
71 views

Job Data View from several Business Units

I'd like to create a script in my parent Business Unit that tells me everything about which mails has been sent to a subscriber from our parent Business Unit (automated sends) and from our child ...
0
votes
1answer
19 views

Defining Map of Tasks using User ID as Key

My goal is to send an email to users with their respective open tasks. I tried: UserInfo.getUserId () but I realized that it only works for the current user. Therefore, I'm trying to create a Map with ...
0
votes
1answer
159 views

How to populate Lightning Data Table with custom columns and data?

Say I have a LWC with a Datatable that displays the values of field A in Column 1, and field B in Column 2. Now I want Column 3 to display the value of Column 1 + Column 2. How would I go about this? ...
0
votes
1answer
27 views

Query involving parent and child objects in where, group by and order by clause

I have an object called SRC which has account as lookup in it. SRC content will be as shown below: SRC ID Account__c Status City__c LastModifiedOn 1 1 Yes Delhi 12-Apr 2 1 No Cochin 13-Apr 3 2 No ...
0
votes
0answers
33 views

Create a Data Extension report with Data View and Journey information

My goal is to create a Data Extension (DE_Journeys_Report) that will contain a report of different Journeys, extracted from different Data Extensions. I need the following fields from the **Sent Data ...
0
votes
2answers
30 views

Querying for RecordType's DeveloperName throws error when generating code through tooling

I get this error when querying for DeveloperName via the Tooling API even though I can perform the same query in the developer console with the same user. "No such column 'developername' on ...
0
votes
0answers
13 views

Is there a way to query past flow runs or interviews?

There is scant information in the Salesforce documentation on the following questions and I would appreciate it if anyone in the know could enlighten me. If a flow was run in the past, is there any ...
0
votes
1answer
45 views

SQL issue in populating a Data extension in Marketing Cloud

Could anyone help identify why this SQL won't populate to a data extension: Select l.Id , l.Email , l.FirstName , l.LastName , l.MC_Lead_Mobile_Phone__c as MobilePhone , l.Salutation , e....
4
votes
1answer
874 views

Are ID's actually Ascending?

From my searching, I know of the issue of if I insert multiple records in one transaction, the order of ids they get may not match the order the records were inserted, which is fine, but if 10 seconds/...

1
2 3 4 5
30