Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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.

1
vote
1answer
23 views

Getting info on files that were shared between dates [on hold]

I'm fairly new to Salesforce API, I'm trying to get information on files that were shared between dates. I would like to know how to retrieve this info using REST API. Is it even possible to query ...
0
votes
1answer
31 views

Violation of PRIMARY KEY constraint. Cannot insert duplicate key

Getting error on the query and is below. Email_Master primary key is 'Email Address' and thee target Data Extension primary key is also 'Email Address'. Can you help/advise what is the issue on the ...
0
votes
1answer
19 views

Query Error: Old style JOIN (ANSI JOINs) syntax is not allowed

I'm trying to build a Segment Count history table. There's three columns in this table. I want to insert 5 rows daily. The code below worked (minus createdate). I needed to add CreateDate so as not to ...
-1
votes
1answer
21 views

Visualforce page dynamic query [on hold]

i need to do an visualforce page that has an field to put a date and based on that date the page will bring me all the custom obj record with that date. Date is a custom field on an custom object. ...
0
votes
0answers
26 views

Query on Suppression List Does not Return any Record

Ive tried the following code but it does not return any record. Select l.SubscriberKey as SubscriberKey, l.[Status] as Status, l.ListName as ListName FROM [_ListSubscribers] l WHERE l.ListName = '...
1
vote
1answer
30 views

How to query the KnowledgeArticleVersion and Linked Article Objects in sfdc

i get "SELECT id, abdulking__Knowledge_Linked_Artical__c ^ ERROR at Row:1:Column:12 No such column 'abdulking__Knowledge_Linked_Artical__c' on entity 'KnowledgeArticleVersion'. If you are ...
1
vote
1answer
29 views

Finding a rider's origin station

Hi: I have a query that I want to run that pulls back the date of a first ride and the depart station. This is my query to date: select Distinct(b.EmailAddress), MIN(cast(b.DepartureDate as Date)) ...
0
votes
1answer
39 views

Invalid Type Error

I am trying to fetch a list in my controller but I am not able to query the object directly and not even able to declare an empty list in my class Here is how I am declaring this in my class List<...
1
vote
2answers
44 views

Too many query rows: 50001 in export csv

I need to create a axpex class that create and send a csv report. In a @future static method I have this query: List<Activity__c> activityList = [ SELECT fields.... , (SELECT Id, fields... ...
0
votes
1answer
27 views

SOQL Parent Child Query Salesforce

I am new to salesforce, I am using the below query to fetch data from Salesforce Approval Process, Here actorId is the Id which matches with the Id of User table. I need User email from the User table ...
0
votes
2answers
37 views

Need solution on query optimaisation

i have below code where i am doing 2 queries and updating the account record. list<account> parentAccount=new list<account>(); list<account> ChildAccount=new list<account>(); ...
0
votes
1answer
43 views

Heap size exceeding 6MB for simple soql and not getting any error. Strange!

I am running a soql to query 10,000 rows of an object & storing the result in a list. When I check my heap size after the query I see 70MB of heap space getting used & I dont get any exception....
0
votes
1answer
22 views

how to assert search.query?

I have these lines in my test class: Contact con = new Contact(); con.FirstName = 'test'; con.LastName = 'test'; insert con; List<List<SObject>> toSearch = Search.query('find \...
2
votes
1answer
30 views

Counter only adds first opportunity id

I have a testclass in which I create serveral opportunities with several values when I system debug these the values are as espected. I use a counter to add the ids from the several opportunities to ...
0
votes
1answer
37 views

Can I pull DISTINCT customers with SQL based on most recent row record only?

So, I have a data extension where data is being saved. My data extension (CustomerSourceDE) looks something like this: Id (text) NULLABLE Email (Email) NULLABLE Customer_FirstName (Text) NULLABLE ...
2
votes
1answer
34 views

How to get only PermissionSet License.Name if License is UserLicense?

Is it possible to get field value by SOQL query only if has some specific value or type? Following example query: SELECT Id, License.Name FROM PermissionSet returns permission sets with field ...
0
votes
2answers
32 views

How to get formula field from invoice without update

I have made a counter for invoices for several offices. The current office to create an invoice is determined by a formulafield. How do I get this in my testclass I tried to query the invoice but it ...
0
votes
1answer
46 views

How to output time field in lightning component

I have used a time field which I want to show in a lightning component When I fill 8:00 in my field my result is 30600000 in my lightning component. I have searched for a time tag or formatting but ...
1
vote
1answer
21 views

Combining result sets from SOSL query

When I query SOSL with multiple RETURNING objects, the result comes as a list of lists, each for a different sObjectType, each sorted by default by the "relevance" of each record in the result set. ...
1
vote
2answers
64 views

Query on system data views in Automation Studio

I was wondering if someone perhaps know how we can identify the system data views we use/have in our account? According to this article we should be able to query for instance the data view: ...
0
votes
0answers
19 views

parsing json response in soql query to access the data of other object - getting null

I’m getting the values from the LiveMessage Session object (When it is an individual query) but when I’m querying it from the Case Object it is showing blank rows (& vice versa).
1
vote
3answers
55 views

How do I query/use apex to find default values for a record type?

How do I query default values for a record type? I'm unsure of which namespaces to use in my apex for record type default values aswell.
0
votes
2answers
39 views

Nested SOQL query giving error

I'm trying to access the value of object 2(LiveText__Conversation_Header__c) from object 1 (Case) and getting error. Query: SELECT (SELECT LiveText__EndedTime__c FROM ...
0
votes
1answer
31 views

Does an Inner Query in Query Locator count towards row governor limit?

The limit with regards to rows in a query locator is 50 million. Does using an inner query reduce the number of possible rows? For example: Query for Query Locator: SELECT Id, (SELECT Id FROM Orders)...
2
votes
1answer
307 views

Is it more efficient to use nested queries?

I am trying to optimise/improve my codes to avoid limits especially for batches, starting on SOQL. I have this query string to get all accounts with closed won opportunities only: query = 'Select ...
1
vote
1answer
32 views

Counting records by sql query and saving the all counts in one data extensions in different columns

So, I have two data extensions and I want to calculate count in 3rd data extension in each individual column. My DE 1 (included all Emails of customers) My DE 2 (included all Emails and Status of ...
0
votes
0answers
30 views

Marketing Cloud: Query data extensions or date event to trigger a Journey?

I am trying to create an entry event for Contacts when the transaction date has been > 120 days or = equal to 120 days in the past. Contacts are synced in a synchronized DE The transaction date is ...
0
votes
2answers
70 views

SQL Query Error: An error occurred while checking the query syntax. Errors: Error while processing square brackets

I am writing a Query where I want to select subscribers from a list wit the values that are added through a form, however I get the following error: "An error occurred while checking the query syntax. ...
0
votes
0answers
35 views

Possible to query to see if a subscriber has completed a Journey?

Is it possible to use SQL to find out if a Subscriber has completed a Journey? If not via SQL, does anyone know of another way? I looked at the Journey Data Views but they don't seem like they're ...
2
votes
1answer
53 views

Similar queries yet different outputs

I am executing 2 similar queries on salesforce soap api which has similar columns (infact the first query has all the columns that the second one has) yet the number of records are coming different, ...
0
votes
1answer
44 views

Writting and Update Query from one Data Extension to another Data Extension

There is a Field called Program_Status in Data Extension (DE) [Recruiter High school Visits V2 - 2018-06-25T124653822] and I would like to update this field based on DE Program_Interest_G that has the ...
2
votes
1answer
95 views

Why do I get a Parse error on date field

I have the following simple query but i am getting a parsing query error, any ideas? SELECT startDate__c FROM invoice__c WHERE startDate__c.month() = 3 startDate__c is a date field. No errors if i ...
1
vote
1answer
80 views

How to approach multiple Rest queries in same method

I have written a Rest Get method where I get a response based on id like, /services/apexrest/invoices/a000X000015ABc2 How do I go about if I want to use this same method for following calls: - GET &...
4
votes
1answer
122 views

Error “Bind variables only allowed in Apex code” simple_salesforce (Python)

Not sure if this belongs here or in StackOverflow, seems 50/50. I am trying to figure out how to build a dynamic query using simple_salesforce and there is no problem using a completely static query ...
1
vote
1answer
219 views

How to move my SOQL query outside for loop?

Hello I need some help moving my SOQL Query outside of my for loop to maintain best practices. I am using the code below to get the most recent opportunity of a selected account and grabbing the ...
0
votes
0answers
25 views

Is there any difference in quering with [] or with Database.query()? [duplicate]

As title says, I know that Database.query() is SOQL. However there is no difference in usage between Database.query() and query inside square brackets, in both you can use dynamic variables, and ...
1
vote
1answer
29 views

How many times did a person enter a journey

I need to figure out how many times a person entered a journey in Marketing cloud. I was able to query how many emails did a person get in a journey by querying the _Journeyactivity Data View, but I ...
1
vote
0answers
18 views

Create Query Definition with Ampscript - incomplete instructions

Marketing Cloud developer documentation is patchy at best, and I'm trying to create and execute a query definition using Ampscript. I have got so far: %%[ VAR @q, @qdf, @qn, @qdf_Key SET @qn = '...
0
votes
0answers
45 views

encrypt email address in a data extension

I'd like to encrypt email address in a data extension with SHA256 within marketing cloud. This will be used as a unique identifier. When the email goes into a data extension, have the email address ...
0
votes
1answer
89 views

Marketing Cloud - Timezone - Format/Display

I guys. Need your help, please. 1 -I know the dates in Marketing are saved in CST timezone, but when I view them in "form mode" I need to see them as GMT / UCT. I have already set up account and user ...
0
votes
2answers
47 views

Time Zones and Synchronized Data Sources - Problems

I just found a big problem in the dates I pulled from service cloud. In summary I sync one object througth service cloud however the fields dates have the wrong information. e.g in service cloud I ...
0
votes
1answer
48 views

DATEDIFF problems

I'm trying to create one activity query and there I need to pick all the records where the diference between today and my fieldDate has a result equal or minus then 4 months. e.g fieldDate will have ...
1
vote
1answer
35 views

Find all Product2 records that do NOT have a PricebookEntry in the Standard Price Book

We have come to find that we have a small amount of products that have Product2 records, but no PricebookEntry for them. I'm trying to query for just those products, but I am having trouble with the ...
0
votes
0answers
38 views

Query All Subscribers unsubscribes at child BU level possible?

Is it still the case that you cannot obtain child-BU unsubscribes from a child-BU and have to query the parent All Subscribers tables? Thank you.
1
vote
1answer
91 views

Query Error with IN operator must be used with an iterable expression

I am trying to pass multiple variables from Process Builder to my Apex Class, and eventually manipulate those values to update fields in the Account object. The below code produces this error message:...
1
vote
1answer
53 views

How can I access _subscribers data view from child business unit?

As the title suggests I would like to query out _Subscribers from within a child Business Unit. When running my query select SubscriberKey, EmailAddress from _subscribers No results are returned, ...
0
votes
0answers
22 views

Why would a query activity fail where a manual import or filter work?

I am currently trying to run a query which selects all records where the Job_Ref column contains 'MSI_13628_HIS_NCC_X1' (a job number). It does not find the full amount of people. For example, there ...
1
vote
2answers
28 views

How to map afield of an object on a map

I have a map for an object for which I want to use a name field on the object as a key and value as map huishoudMap = new map Is there something similar to map ? How do I achieve this using map: ...
-2
votes
1answer
54 views

Parent to child SOQL query is not working

SELECT Id, CurrencyIsoCode, ExpirationDate__c, (SELECT Id, Regional_Starting_Price_2__c FROM SBQQ__QuoteLine__c) FROM SBQQ__Quote__c WHERE ...
1
vote
1answer
37 views

Do we have `setQueryOptions` for tooling API?

The Symbol table is only queried through tooling API. Do we have an option to set setQueryOptions when doing that, or similar way of setting batch size to do that. Because when running query() and ...