Tagged Questions

A Salesforce Object Query Language (SOQL), modeled on SQL, for accessing information saved in the Salesforce database.

learn more… | top users | synonyms

1
vote
1answer
8 views

SSIS with Salesforce as source: What's the equivelnet of “SELECT * FROM…”

I've inherited a SQL Server Information Services (SSIS) package / TaskFactory where the data source is SalesForce. One table has 761 columns, and when I try to map it using a TF Source control, and ...
1
vote
2answers
18 views

using group by in my query

I have the following query that adds each record to a list that is displayed in as dataTable on a Visualforce page. for (MyObject__c obj : [SELECT Date__c, Stage__c, Members__c, Type__c, ...
1
vote
1answer
30 views

Why is my SOQl Query with OR filtering this much slow?

I'm trying to get some records from a CustomObject. This is my object relationships: Object A [ObjectA__c] -- Child Object B (master-detail link) [ObjectB__c] My query is like this: ...
1
vote
1answer
33 views

How to query all records changed since date?

Is there a way to query all records of all object types changed since a given date? SOQL doesn't appear to have a way to do this. I thought that the "From" clause might have a way, but when I tried ...
1
vote
2answers
30 views

Query Salesforce to find any records created in past “X” hours

My organization does monthly deployments from our sandbox to production that include bug fixes and enhancements. When we deploy to production, we do testing to make sure that everything is working as ...
2
votes
1answer
23 views

No “Personnal Folder” when querying the Folder through SOQL

I'm using the Salesforce REST API and when I do the following query, it doesn't return the "My personnal folder", hence I don't get its ID : SELECT Id, Name, LastModifiedDate FROM Folder Is there ...
1
vote
1answer
11 views

Where are my VisualForce Bar Chart's Bar's?

Currently looking at Providing Chart Data via a Controller Method. Something seems to be either missing or failing, as the bar chart is being displayed WITHOUT the bars: Here is my VF Page: ...
0
votes
0answers
17 views

Having issue with SOQL finding newly created records

I have a system set up using Twilio to log calls in visualforce. After each call, it creates a custom Call_Log__c object, with a DialId field set to an arbitrary string eg. 'abc123' I also have a ...
2
votes
1answer
30 views

SOQL Query ( User - Opportunity - Task)

I created an email template, component and controller that will send different set of records for each user that has a specific profile. I am having problems in my query in selecting the users that is ...
2
votes
1answer
30 views

How to determine which fields can't be part of WHERE clause in SOQL to avoid the “MALFORMED_QUERY: Implementation restriction” error

There are certain fields in certain sObjects, which can't be used in WHERE clauses in SOQL queries. One example is: "SELECT Id FROM Vote WHERE SystemModstamp > 2014-11-19T14:32:14.802+01:00" You ...
1
vote
2answers
106 views

How to query the data that has been modified in last 24 hours

How to define the "where clause" in SFDC SOQL to extract the date that have been modified in last 24 hours. Thanks. PS : I am using the QUERY rest URI for query the data.
2
votes
1answer
23 views

Display all the users and profiles assigned to each record

I have the following Class and the Page displaying all records from an object. I want to display all Users and Profiles assigned to each record in front of each record in separate columns. How do I ...
1
vote
1answer
34 views

Trigger to match fields in another object

I have 2 custom objects Timecard (pse__Timecard_Header__c) Period (c2g__codaPeriod__c). They don't have relationship. Timecard fields:- Start date (pse__Start_Date__c), Close date ...
6
votes
4answers
204 views

Multiple SOQL queries in single request

I want to query Lead and Contact object using SOQL and retrieve Id of either of object. For example: select Id from Lead where email = 'a@a.com' select Id from Contact where email = 'a@a.com' These ...
2
votes
1answer
37 views

Default sort order of the records in SOQL [duplicate]

I queried SELECT Id, Name FROM User LIMIT 10 It generates list of 10 users in some order randomly. On what basis does Salesforce give these 10 records? Ordered by CreatedBy ASC? DESC? Name ASC? ...
4
votes
1answer
57 views

Are there limitations on querying Tasks

I am trying to bulk re-parent activities from one object to a new object. When I use the following SOQL query I get no results even though I know the record exists: SELECT Id,WhatId FROM Task ...
0
votes
1answer
34 views

List all fields of query with subquery

I have this query: List<sobject> query_result = Database.query(query); with query = SELECT Email,Fax,(SELECT Status,Type FROM Cases),(SELECT CreatedDate FROM Tasks)FROM Contact WHERE Id = How ...
3
votes
1answer
36 views

SOQL to get all tasks of opportunities for an account

I am still new to Salesforce and haven't quite wrapped my head around SOQL queries yet. I still tend to think more in terms of SQL. Anyway, I am trying to write a statement that gives me all "Call ...
2
votes
1answer
36 views

Does visualforce/soql not respect field precision?

I've got a webservice that generates some XML for a templating engine to make some sales collateral. Noticing that in some cases users get a ton of extra decimal places in the output for one ...
0
votes
0answers
12 views

Is there a way to tell if custom indexes exist on an object?

I want to be able to design to use indexes and custom indexes where they exist. Is there a way to tell if custom indexes have previously been created on a field?
0
votes
1answer
22 views

how to soql query on standard object product2

Im querying on Product 2 as [select id,name,ListPrice ,Quantity from Product2]; but it throws an Error as :No such column 'ListPrice' on entity 'Product2'.Do i need you to use opportunitylineitem or ...
1
vote
2answers
31 views

relationshipName - Parent child relationship dynamic query

I'm trying to get relationshipName for standard childobject to build dynamic query. Is there any function that returns the queryable name of the standard sObject for SOQL query. Example : ...
2
votes
1answer
34 views

“No target url” in REST response

I'm using the REST API to make the following SOQL query: ...
2
votes
1answer
48 views

How to get the Profile name form the userinfo

I have integrated with the .net and I want the profile name from the login result. Is there any possible? Question 2: When we query the opportunity record in c#, i want the modified ...
3
votes
1answer
41 views

Efficiency when querying data with dynamic SOQL vs. formula fields

I am coding a search functionality where I have several parameters to search for (Account Name, Location Name, several kinds of dates, etc. My question is, when filtering the data in the SOQL query ...
1
vote
1answer
36 views

What are the SOQL queries for the actvityHistory and OpenActivity Related lists?

Does anyone know what soql queries you would run on Task and Event equivalent to what salesforce uses to generate the Activity History and Open Activities related lists. The OpenActivity and ...
1
vote
1answer
31 views

System.SObjectException: Field is not writeable: CampaignMember.ContactId

Can anybody help me figure out why Salesforce is saying the Campaign Member ContactId field is not writeable? I have Dedupe logic that runs on Contact after insertion, if it matches an existing ...
1
vote
1answer
20 views

Querying Participants on a Task

What is the SOQL to query all participants on a Task? Where is this information stored? WhoId will only give me one of the participants. Or more specifically how can I query all Tasks for which there ...
0
votes
0answers
14 views

Filtering form insert on master-detail relationship

I have a form on my html based visualforce page where users can submit comments on a topic I post. I am using a Challenge custom object and a Challenge Comment custom object. These are both connected ...
2
votes
2answers
90 views

What is the proper syntax for this SOQL query?

I am trying the following SOQL query and getting an error stating the query is malformed. Select Id from Program__c Where Id In (Select ParentId from Attachment where Description LIKE '%Resume%')
1
vote
0answers
25 views

Trigger on Opportunity - find out what OpportunityLineItem was deleted

I have a trigger on the Opportunity that fires BeforeInsert & BeforeUpdate. Among other things, one of the requirements of the trigger is that a specific field on the opportunity is updated if an ...
0
votes
1answer
44 views

How to fix the vulnerable to SOQL injection attacks error in sales force?

In my Custom visual force page i have coded iframe like this: $("a#icsFrame8").click(function () { document.getElementById("myIFrame").src = '/apex/Samplepage?isdtp=mn'; But, After we did a ...
4
votes
2answers
133 views

Search Account by Id

This is really simple but I can't figure out why it's not working I'm trying to get the Account Name from Id SELECT Id, Name FROM Account WHERE Id = "001d000001xxxxxxxx" If I run this in the force ...
0
votes
0answers
29 views

SOQL Subquery Header

Is there a way to not show the headers as looping into the subquery results? see below. Is there a way to not show the "lastname" header? Thanks, John
0
votes
0answers
21 views

Salesforce “ActivityHistory > ActivityType” nested SOQL returns garbage like 1_, 0_

I'm running this query to get all activity history associated with opportunities: SELECT (SELECT Id, Subject, ActivityType, ActivityDate, OwnerId, CreatedBy.Name,Description FROM ActivityHistories) ...
2
votes
1answer
35 views

How to specify BatchSize in Rest API SOQL call?

How to specify BatchSize in Rest API SOQL call, I tried it as per salesforce documentation and its not working ? Note - I know you can do this using offset, but I wanted to explore if its possible ...
0
votes
1answer
28 views

Use CALENDAR_MONTH/CALENDAR_YEAR with Task.AtivityDate in SOQL Query

Need your help here. I'm building a calendar to show the Due Dates of my tasks by month. My query is this: SELECT Owner.Name, OwnerId, id, Subject, ActivityDate, Status FROM task WHERE ...
0
votes
2answers
30 views

How to accesss the fields of set of account id

I have a existing method, passing set of accout id and string into this method. I want to check a field in the every account record, how can i do this. Please help public static List<id> ...
2
votes
2answers
80 views

How to Query what Salesforce SObjects a user has access to

Please suggest How to Query what Salesforce SObjects a user has access to ? Based on this i want to give access to user on particular apex tab menu . Thanks
0
votes
1answer
44 views

Unable to query Opportunity Contact Roles

I'm trying to get a list (and ultimately the ContactIds) of Contact Roles associated with an Opportunity in an after-update trigger, but the size of this list is always 0, even when there are Contact ...
0
votes
2answers
31 views

Displaying results of a nested SOQL query in Schema Explorer

I have two custom objects, Team (parent) and Player (child). I'm using Schema Explorer in the Force.com IDE to understand the data that exists in those objects. I tried the following simple query as a ...
1
vote
1answer
33 views

Querying from Multiple Objects

I've to Query a field(e.g X) from one object. Say I'm getting 20 records(LIST) Now, I've to Query another object using result of above Query using field X (X field is common to both objects but has ...
2
votes
1answer
51 views

SOQL on Rich text fields long text

I'm working on a custom search page, which will search through the fields of the Project object. I use dynamic SOQL query similar to that: SELECT Id, Name, Link_Test__c, ...
1
vote
1answer
20 views

Get Contact info and CampaignMember status in one query

Is there a way to retrieve contact information (first name, last name) and campaign member status for all members of a campaign in one SOQL query? I know you can get just the contact information with: ...
3
votes
2answers
146 views

Check for a picklist value using SOQL

I have the following SOQL and I only need values from Risk__Actions__r WHERE Risk__Status__c(Picklist) equals to 'Open'. But current way i'm doing displays an error. no viable alternative at ...
1
vote
1answer
37 views

Get Minimum Date from records fitting Specific where clause

Trying to get field with the earliest date from custom object. Here is my current query BomaGroups = [SELECT Name, Location__c FROM Group__c WHERE Location__c =:id]; // Selects the Group I want ...
0
votes
3answers
25 views

I need to find all the AccountID from Account where the Phone number does not start with '00'

I tried with this: SELECT AccountID FROM ACCOUNT WHERE NOT PHONE LIKE \'00%\' It's giving me error: "No viable alterative character "\" "
2
votes
1answer
32 views

SOQL Query returns results, however written in SOSL it returns nothing

I am trying to find contacts by Phone number. I require using SOSL due to it's search excluding non-alphanumeric chars but cannot get the same (or any) results from SOSL as I can from SOQL. I am using ...
2
votes
2answers
105 views

“Where” clause which removes alphanumeric characters?

I would like to write a query which searches based on a telephone number through SOAP API. In the clients SOQL DB the number could contain other string characters other than numbers such as: ...
1
vote
1answer
37 views

Why does upsert check lookup to determine duplicates rather than ID?

In a salesforce project, I have an object called Project__c which I want to upsert. I have recently added a lookup to the Project__c object and now when I do an upsert project, the following error ...