Questions tagged [soql]

SOQL is the Salesforce Object Query Language.

SOQL, the Salesforce Object Query Language is a SQL like syntax used on the force.com platform to query records within a Salesforce instance. It can be used in triggers, or fully fledged Apex code, or via their web services API.

748 questions
-1
votes
1 answer

Check if record has inactivity in last 4 hours

Below is my scenario : Case gets created in salesforce using Email-To-Case and default owner is assigned as Queue. Now if case stays with Queue and does not get assigned to any user (Meaning inactivity on that record) for 4 hours, I need to send…
sForSujit
  • 987
  • 1
  • 10
  • 24
-1
votes
1 answer

Switch statement in Apex SOQL

I have below SOQL statement in an Apex class, Column Promotion returns true or false, If the value is true then it should return 'Promo Enabled' otherwise ''. Can we handle this within the select query? @AuraEnabled public static Object…
GVMK
  • 27
  • 1
  • 1
  • 6
-1
votes
1 answer

How to include null values into grouping by date?

I'd like to split number of emails added to the database by month and year. My query: SELECT TOP 200 Monthh, Yearr, COUNT(Email) AS Amount FROM (SELECT Email, MONTH(Added_date) AS Monthh, YEAR(Added_date) AS Yearr FROM Contacts) a …
Amberjack
  • 45
  • 5
-1
votes
2 answers

Should I care about sql injection after user has been authenticated?

Does make sense to check on malicious SQL input from an authenticated user?
Chi
  • 1
  • 1
-1
votes
1 answer

System.QueryException: List has more than 1 row for assignment to SObject

public void search () { string searchquery='select Car_Name__c ,id from car__c where Car_Name__c like \'%'+ searchkey+'%\' Limit 20'; sim=Database.query(searchquery); } System.QueryException: List has more…
Harsh
  • 1
  • 1
-1
votes
2 answers

Pull values from string to assign into an array

I've got a project where I'm pulling data from SOQL using salesforce's RestAPI. I've cleaned up the response and this is what I'm currently working…
pseudoseed
  • 21
  • 3
-1
votes
2 answers

SOQL/SQL: Result of left outer join query is not correct

I am quite stuck regarding a query. I have three objects in Salesforce: Contact, CampaignMember, Campaign. Now, I want to get all the contacts which are in campaign 'A' but NOT in campaign 'B'. My code belwo doesn't work: SELECT Contact.FirstName,…
Lekü
  • 53
  • 1
  • 6
-1
votes
1 answer

salesforce SOQL with group by (math before the group by)

I want to use math of two columns and then sum up while fetching data with the group by class in SOQL. (math should happen before the Sum). I am trying something like this... please ignore the syntax. "select sum(netprice), sum(listprice),…
rajesh
  • 1
-1
votes
2 answers

Salesforce custom object with custom field and standard field

I have one custom object 'Territory__c' which have standard Field "Name" and custom field "Territory_Ex_ID__c". So what would be SOQL whole data. Suppose the user list I want to fetch with this detail included. I am new to salesforce, so please help…
curiousMind
  • 2,812
  • 1
  • 17
  • 38
-1
votes
1 answer

How to query Salesforce from NetSuite SuiteScript 2.0?

How would you go about querying Salesforce from a NetSuite suitescript?
bogus
  • 457
  • 5
  • 16
-1
votes
1 answer

I see nothing in my object "PrincipalProduit__c"

I want to update the information contained in my "var" variable in my "PrincipalProduit__c" object, using this function public void DMLOperation () { List letter = getValo (); List updateList = new List…
-1
votes
1 answer

I am using SOQL for accessing the data of salesforce using java

String uri = baseUri + "/query?q=Select+Id+from+Account+where+Id=+ ('017F00000nqmNPQAY')"; I am using SOQL for querying the data, it is working fine without where clause, but I don't know how to write it with where clause, It is throwing error when…
-1
votes
1 answer

add single quotes and commas outside the quotes in string

I'd like to take a list of Ids <- c("00234nisduf", "928347ksjdfn", "92837sdfjkbnfgh") Ids [1] "00234nisduf" "928347ksjdfn" "92837sdfjkbnfgh" And turn it into a SOQL query: Id_Query <- "'00234nisduf', '928347ksjdfn', '92837sdfjkbnfgh'" The…
Matt W.
  • 3,692
  • 2
  • 23
  • 46
-1
votes
3 answers

using SOQL Query not able to fetch Account Applicant_ID__c

I have an external id in Account named Applicant_ID__c. I am using data loader to import data into salesforce Opportunity. Below is my mapping file content. Date\ Cancelled=Date_Cancelled__c Date\ Denied=Date_Denied__c Date\…
-1
votes
1 answer

Why RecordType is added in the SOQL?

Why is RecordType added in the below SOQL Query? [Select UserId, LoginTime from LoginHistory RecordType where UserId=:UserInfo.getUserId()]; Here LoginHistory is an Object. Please help.
Subha
  • 19
  • 1
  • 5
1 2 3
49
50