-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
17Questions
-
10Replies
Filter soql queries based on dates
-
- Praetorian65
- October 01, 2009
- Like
- 0
- Continue reading or reply
System.Exception: Too many SOQL queries: 21
I have this error with an after update trigger in salesforce. The trigger definately does not do more than 8 SOQL queries at once and that is the most it can ever do. I am inserting objects via the API and I am doing them in batches. Does a batch of licences count towards this ie 4 queries + 4 queries + 4 queries + 4 queries + 4 queries = 22 queries = error? If so this is a pretty ridiculous limitation.
There are no loops or anything in the trigger.
-
- Praetorian65
- August 10, 2009
- Like
- 0
- Continue reading or reply
Formula - Time difference between two dates
-
- Praetorian65
- August 07, 2009
- Like
- 0
- Continue reading or reply
Case email auto-response
I have
an auto response rule set up when a case is opened in salesforce. We
are generating these through the API but it doesn't seem to work. It
also doesnt work when adding a case through the salesforce UI. I added
a debug log and it appears to be running the rule and sending the email
but nothing actually happens:
*** Beginning Workflow Evaluation
User: ******* support
Start Time: 20090720104959.261
Starting All Rules Evaluation
Starting evaluation of rule type Assignment
Starting evaluation of rule type Response
[Case: #SL0609-000111 50020000006fnVH]
Rule Name: Ticket Responder
Evaluating Workflow Entry Criteria:
Rule entry order: 1
[Case : Status equals Opened]
Value found: Opened
Criteria evaluates to true
Spooling All Immediate Actions
[Case: #SL0609-000111 50020000006fnVH]
Response notify: ******* support, Email: support@******.com
Template: 00X200000016TbS
Ending All Rules Evaluation
Bulk Execute all Immediate Actions
Starting evaluation of rule type Workflow
Starting evaluation of rule type Escalation
End Time: 20090720104959.323
*** Ending Workflow Evaluation
Is there a setting that I have missed that will allow this to work? I haven't had any error messages for this (and yes, I edited the error message with asterisks for data security reasons).
-
- Praetorian65
- July 23, 2009
- Like
- 0
- Continue reading or reply
Deleting a custom object record via the api
-
- Praetorian65
- July 23, 2009
- Like
- 0
- Continue reading or reply
Apex triggers - SForce UI or API
-
- Praetorian65
- June 22, 2009
- Like
- 0
- Continue reading or reply
Picklist in salesforce - Not working
I used ant with the force.com migration tool to migrate some developer sandbox changes to our full sandbox and one of our picklists does not work. It is on the account object and it either isn't selectable or has only one value to select. The actual picklist was set up with two values with no validation and no dependencies. When we first migrated our changes it wasn't editable. I then set it to NOT be a required field on the page layouts and that made it editable. For some reason it still only had one selectable value though. I then set up a dependency that made all options available for all possible values of the parent field. This allowed both options to be selected for one account but when I went to another account it had only one selectable value again. I then changed the account type (the parent field) and this left no selectable values in the child picklist. This is not what it is set up to do. What is going on here?
EDIT: The picklist works fine in the controlling field preview, but not on the actual account pages. This is crazy.
-
- Praetorian65
- June 15, 2009
- Like
- 0
- Continue reading or reply
Force.com migration tool
-
- Praetorian65
- June 08, 2009
- Like
- 0
- Continue reading or reply
Outbound message timeouts
Is there a way to increase the timeout on an outbound message? I have an outbound message that generates product data on an external database but with a large amount of products this takes time. If the webservice times out it causes the data to be generated again. This is very very bad.
I could return immediately and process asynchronously but this defeats the object of outbound messaging. Just because the webservice is active it doesn't mean it will succeed.
-
- Praetorian65
- May 14, 2009
- Like
- 0
- Continue reading or reply
Cannot login to salesforce production environment from eclipse
-
- Praetorian65
- May 11, 2009
- Like
- 0
- Continue reading or reply
Scheduled Apex
-
- Praetorian65
- January 12, 2009
- Like
- 0
- Continue reading or reply
Using Javascript to run apex from a VF page
function reportSuccessOrFail() { try { var success = sforce.apex.execute("ReadResult","GetResult",{}); if(success ==true) alert('Salesforce data successfully updated'); else alert('There was an error with the update'); } catch (e) { alert(e.name + ' ' + e.message); } }
This uses the following apex class:
global class ReadResult{ webservice static boolean GetResult() { boolean returnresult = false; DateTime timefrom = DateTime.now(); DatabaseRequest__c[] dbr = [select Result__c from DatabaseRequest__c order by Time__c desc]; if(dbr.size()>0) { returnresult = dbr[0].Result__c; } return returnresult; } }
When I run it I get the error: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Message Edited by Praetorian65 on 01-07-2009 06:05 AM
-
- Praetorian65
- January 07, 2009
- Like
- 0
- Continue reading or reply
Solved - Visualforce page using an existing tab view?
Message Edited by Praetorian65 on 01-07-2009 02:19 AM
-
- Praetorian65
- January 07, 2009
- Like
- 0
- Continue reading or reply
Running an apex script
-
- Praetorian65
- January 06, 2009
- Like
- 0
- Continue reading or reply
Error: Compile Error: Initial term of field expression must be a concrete SObject
try{ While(licenseArray.Size() > 0) { for(Integer i = 0; i < licenseArray.Size(); i++) { date endD; date startD; if(licenseArray[i].StartDate != null) { //DateTime startDateTime = licenseArray[i].StartDate; Integer startYear = licenseArray[i].startDate.Year; Integer startMonth = licenseArray[i].startDate.Month; Integer startDay = licenseArray[i].startDate.Day; startD = date.newinstance(startYear,startMonth,startDay); } if(licenseArray[i].EndDate != null) { DateTime endDateTime = licenseArray[i].EndDate; Integer endYear = endDateTime.Year; Integer endMonth = endDateTime.Month; Integer endDay = endDateTime.Day; endD = date.newinstance(endYear,endMonth,endDay); } License__c newLicense = new License__c(ContactName__c = licenseArray[i].ContactName, NetworkCode__c = licenseArray[i].NetworkCode, Period__c = licenseArray[i].Period, Number__c = licenseArray[i].Number_x, EndDate__c = endD, StartDate__c = startD); myList.Add(newLicense); if(myList.Size() == 1000) { myListList.Add(myList); myList = new List<License__c>(); } } index = index + count; licenses = data.GetLicenseData(index,count); licenseArray = licenses.License; } } catch (Exception ex) { }
-
- Praetorian65
- January 05, 2009
- Like
- 0
- Continue reading or reply
Code to create objects from XML
-
- Praetorian65
- December 19, 2008
- Like
- 0
- Continue reading or reply
Retrieving external xml data
Message Edited by Praetorian65 on 12-18-2008 03:50 AM
Message Edited by Praetorian65 on 12-18-2008 03:50 AM
-
- Praetorian65
- December 18, 2008
- Like
- 0
- Continue reading or reply
Formula - Time difference between two dates
- Praetorian65
- August 07, 2009
- Like
- 0
- Continue reading or reply
How to integrate my dot net application with web service of force.com
Hi, I am a .net developer and new to salesforce.
I want to add the webservice api to my project.
But I am unable to start.
Is there any video or step by step tutorials for this ?
- somac
- June 19, 2009
- Like
- 0
- Continue reading or reply
Outbound message timeouts
Is there a way to increase the timeout on an outbound message? I have an outbound message that generates product data on an external database but with a large amount of products this takes time. If the webservice times out it causes the data to be generated again. This is very very bad.
I could return immediately and process asynchronously but this defeats the object of outbound messaging. Just because the webservice is active it doesn't mean it will succeed.
- Praetorian65
- May 14, 2009
- Like
- 0
- Continue reading or reply
Cannot login to salesforce production environment from eclipse
- Praetorian65
- May 11, 2009
- Like
- 0
- Continue reading or reply
Activity Completed Apex Trigger
I would like to track the date and time of day when tasks are marked "Completed". This functionality is not captured by Due Date or Date of Last Activity.
trigger DateCompleted on Task ( before insert, before update )
{
try
{
// task.DateCompleted = todaysDate();
// task.TimeCompleted = now;
}
catch ( Exception ex )
{
}
}
I'd appreciate your help on this - also (and related), I looked around for some time, but could not find a resource with a bunch of example Apex triggers - this would be really helpful.
- DougWD
- January 13, 2009
- Like
- 1
- Continue reading or reply
how can solve System.Exception: Too many SOQL queries: 101
I have found an exception :
System.Exception: Too many SOQL queries: 101
I explain my problem with simple example.This example look like as my application:
public class class1
{
void show()
{
for(Integer i=0;i<5;i++)
{
Double d1=class2.getData();
Double d2=class3.getData();
}
}
public pageReference save()
{
show();
}
}
// Another Apex class
global class class2
{
Webservice static Double getData()
{
Double d=0.0;
for(Integer i=0;i<12;i++)
{
// perform SOQL Query
//just like......
for(Object__ c:[select id__c from Object__c])
{
d=c.id__c;
}
}
return d;
}
}
// Another Apex class
global class class3
{
Webservice static Double getData()
{
Double d=0.0;
for(Integer i=0;i<12;i++)
{
// perform SOQL Query
//just like......
for(Object__ c:[select id__c from Object__c])
{
d=c.id__c;
}
}
return d;
}
}
When i call save() from visual force page i am getting exception Too many SOQL queries.
Please solve my problem.
Thanks & Regards
Brijesh Kumar Baser
- Brijesh Kumar
- January 13, 2009
- Like
- 0
- Continue reading or reply
I have a question about "List"
B: List<Account> flstAccount = [select id from account];
What is the difference between A and B?
thank you.
Message Edited by china.leaf on 01-12-2009 11:24 PM
- china.leaf
- January 13, 2009
- Like
- 0
- Continue reading or reply
Using Javascript to run apex from a VF page
function reportSuccessOrFail() { try { var success = sforce.apex.execute("ReadResult","GetResult",{}); if(success ==true) alert('Salesforce data successfully updated'); else alert('There was an error with the update'); } catch (e) { alert(e.name + ' ' + e.message); } }
This uses the following apex class:
global class ReadResult{ webservice static boolean GetResult() { boolean returnresult = false; DateTime timefrom = DateTime.now(); DatabaseRequest__c[] dbr = [select Result__c from DatabaseRequest__c order by Time__c desc]; if(dbr.size()>0) { returnresult = dbr[0].Result__c; } return returnresult; } }
When I run it I get the error: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Message Edited by Praetorian65 on 01-07-2009 06:05 AM
- Praetorian65
- January 07, 2009
- Like
- 0
- Continue reading or reply
Error: Compile Error: Initial term of field expression must be a concrete SObject
try{ While(licenseArray.Size() > 0) { for(Integer i = 0; i < licenseArray.Size(); i++) { date endD; date startD; if(licenseArray[i].StartDate != null) { //DateTime startDateTime = licenseArray[i].StartDate; Integer startYear = licenseArray[i].startDate.Year; Integer startMonth = licenseArray[i].startDate.Month; Integer startDay = licenseArray[i].startDate.Day; startD = date.newinstance(startYear,startMonth,startDay); } if(licenseArray[i].EndDate != null) { DateTime endDateTime = licenseArray[i].EndDate; Integer endYear = endDateTime.Year; Integer endMonth = endDateTime.Month; Integer endDay = endDateTime.Day; endD = date.newinstance(endYear,endMonth,endDay); } License__c newLicense = new License__c(ContactName__c = licenseArray[i].ContactName, NetworkCode__c = licenseArray[i].NetworkCode, Period__c = licenseArray[i].Period, Number__c = licenseArray[i].Number_x, EndDate__c = endD, StartDate__c = startD); myList.Add(newLicense); if(myList.Size() == 1000) { myListList.Add(myList); myList = new List<License__c>(); } } index = index + count; licenses = data.GetLicenseData(index,count); licenseArray = licenses.License; } } catch (Exception ex) { }
- Praetorian65
- January 05, 2009
- Like
- 0
- Continue reading or reply