soql

Simple_Salesforce: making bulk SQL calls within a date range

本秂侑毒 提交于 2019-12-12 19:18:48
问题 I'm using Simple_Salesforce to grab a chunk of data using the salesforce api. I was wondering if there was anyway to specify a date range when making calls. I keep getting the following error. query = 'SELECT Id, Name FROM Account WHERE createddate > 1451621381000' sf.bulk.Account.query(query) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/simple_salesforce/bulk.py", line 157, in _get_batch_results url_query_results = "{}{}{}".format(url, '/', result.json(

Adding Columns dynamically to Salesforce Reports

痴心易碎 提交于 2019-12-11 14:11:47
问题 I need to add columns to a salesforce report dynamically(based on particular conditions). I'm planning to do this with a trigger that is looking for my conditions. My two questions, Is it possible to adding columns dynamically for a Report? Can we schedule triggers based on time intervals instead of database updates? Thanks, BR Madura 回答1: I'm not aware of any possibility to manipulate Reports from Apex. Report definitions can be retrieved and modified with Metadata API (the one used in

Escaping & (ampersand) in SOQL

旧城冷巷雨未停 提交于 2019-12-11 07:35:19
问题 I have this piece of code to search for data on Salesforce: Code: $campaign_name = 'A & B Campaign'; $search = 'FIND {'.$campaign_name.'} IN NAME FIELDS RETURNING CAMPAIGN(ID)'; $searchResult = $mySforceConnection->search($search); var_dump('$searchResult: ' . print_r($searchResult, true)); Error: mismatched character '&' expecting '}' I tried to use preg_replace , htmlentities , I keep getting the same error, what can I do to be able to search for strings containing & ? Thanks. 回答1: You need

How do I display the results of an aggregate SOQL query on a Visualforce page?

青春壹個敷衍的年華 提交于 2019-12-11 02:48:33
问题 I'm very new to Visualforce. I'm looking at this page here: http://force.siddheshkabe.co.in/2010/11/displaying-aggregate-result-on.html So when I added this code onto a VisualForce page: AggregateResult[] groupedResults = [SELECT Name, Days__c FROM Contact WHERE Days__c != ]; for (AggregateResult ar : groupedResults) { System.debug('Name: ' + ar.get('Name') + '\nDays Taken : ' + ar.get('Days__c') + '\n'); But all it does is print the code instead of executing it. What should I be doing?

Execution Confusion in Batch class Apex

断了今生、忘了曾经 提交于 2019-12-10 22:43:53
问题 I am calling a batch class instance and after completing the batch, I am calling two other batch class instances. The finish() method for first batch class is public void finish(Database.BatchableContext BC) { List<Event__c> events = [SELECT Id FROM Event__c]; delete events; System.debug('Executing finish'); for (CalendarSettings__c c: [SELECT Id, Name, CalendarId__c, CalendarQuery__c, FieldToDisplay__c FROM CalendarSettings__c]) { System.debug('Calendar Id is' + c.CalendarId__c);

How to get Email from Task object record using SOQL

廉价感情. 提交于 2019-12-07 03:01:17
问题 I am trying to get the Contact/Lead email from the Task object using SOQL (I am creating an interface in PHP to back up messages with a specific subject). Here is my query right now: SELECT Subject,Who.FirstName,Who.LastName,Who.Email,Who.Phone,Description FROM Task This works/doesn't throw an error and gives me results, but Who.Email is always empty (and, coincidentally Who.Phone is as well, but it is not very important for this). If I try just using Email I get an error that the field doesn

SOQL Type conversion (SalesForce.com)

时光毁灭记忆、已成空白 提交于 2019-12-01 16:06:36
The problem is that I need to compare two fields of different types in a SOQL query. TextField is a Picklist (so really text) and IntField is a Number(2, 0). Changing the types of these fields is not possible. I would like to write SOQL like; SELECT Id FROM SomeObject__c WHERE Cast(TextField as Integer) > IntField Obviously Cast(TextField as Integer) does NOT work. Any advise on type conversion within SOQL. The normal APEX functions (e.g. integer.valueof) don't seem to be of any help here. Thanks SOQL itself does not support casting but you can always lend a helping hand ;) Create a Numeric

SOQL Type conversion (SalesForce.com)

拥有回忆 提交于 2019-12-01 15:07:52
问题 The problem is that I need to compare two fields of different types in a SOQL query. TextField is a Picklist (so really text) and IntField is a Number(2, 0). Changing the types of these fields is not possible. I would like to write SOQL like; SELECT Id FROM SomeObject__c WHERE Cast(TextField as Integer) > IntField Obviously Cast(TextField as Integer) does NOT work. Any advise on type conversion within SOQL. The normal APEX functions (e.g. integer.valueof) don't seem to be of any help here.

Talend - Limit Number of Rows Processed

爱⌒轻易说出口 提交于 2019-12-01 13:32:11
问题 I'm working with Talend ETL to transfer data between two Salesforce Orgs. I'm trying to run preliminary tests to make sure everything is setup properly. Is there a way to limit the number of rows being transferred? The database has over 50,000 rows, and I only want to send over 15 or 20. Thank you. 回答1: On the Talend side, you can use tSampleRow to only process a limited number of rows which were retrieved . For example you can use a line number range to only process rows 1-50. 来源: https:/

salesforce SOQL : query to fetch all the fields on the entity

梦想的初衷 提交于 2019-11-30 07:57:53
问题 I was going through the SOQL documentation , but couldn't find query to fetch all the field data of an entity say , Account , like select * from Account [ SQL syntax ] Is there a syntax like the above in SOQL to fetch all the data of account , or the only way is to list all the fields ( though there are lot of fields to be queried ) 回答1: You have to specify the fields, if you want to build something dynamic the describeSObject call returns the metadata about all the fields for an object, so