Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions relating to Apex, the native programming language for the Force.com platform. Use it for general questions on syntax, errors, constructs, and rules of use. Most questions should include a code *excerpt* to help answerers understand specifically what has gone wrong or why you need help.
1
vote
Custom Button that mass updates fields in an Object (APEX)
On the controller:
public void updateMyAccounts() {
Object__c[] objs = [SELECT id, Custom_Date_Field__c FROM Object__c WHERE CreatedDate = TODAY];
for (Object__c obj : objs) {
obj.Custom_Dat …
4
votes
Test class for scheduler class
Here's how to test a scheduled class
@isTest
private class testscheduledclass
{
public static String CRON_EXP = '0 0 0 15 3 ? 2022';
static testmethod void test1()
{ …
4
votes
2
answers
1k
views
Tightening security around Javascript Remoting from Visualforce
Due to the complexity of our org, most of the Apex classes holding these remote methods are set to "without sharing" to bypass Salesforce's profile level and object security. … In doing so, security can pass whichever user ID they would like and our Apex remote method will take that User ID without issue (since there is no security being enforced). …
4
votes
0
answers
959
views
Not receiving Apex exception emails
I am unable to receive any Apex exception emails in both my own dev playground org and the sandboxes/production org for the company I work for. … I also have "Send Apex Warning Emails" checked on my user record, and I do recieve warnings for getting near governor limits. …
1
vote
1
answer
584
views
Exposing an Apex REST API service - running into limit issues
We are trying to expose a service in Salesforce using Apex that external systems can call. This service is pretty simple. …
-1
votes
1
answer
2k
views
API limits and how many concurrent API requests Salesforce can process
I know already there is a concurrent request limit for Apex for long-running transactions. … If ~10+ Apex transactions occurring at the same time each take over 20 seconds, the system will lockup and throw concurrent request limit exceeded error. …
0
votes
1
answer
261
views
Google reCaptcha to protect Apex Remote method
Problem is Apex remote calls can be exploited. … Is there a way I can lock an apex remote method called from a guest user behind reCAPTCHA? …
1
vote
1
answer
2k
views
Calling multiple batch jobs from one scheduled class method
I was wondering if it's a good idea or even possible to call multiple batch jobs from one scheduled class. Every year at the beginning of the year we want to create records for each sales rep for each …
4
votes
2
answers
16k
views
Concurrent requests limit exceeded - how to find the problematic code
Our pages are built using AngularJS to remotely call Apex code. We are on an Unlimited Edition org and we are nearing 90% of our total allowed code. … I wrote Javascript to remotely call an Apex method that waits for 6 seconds. …
2
votes
2
answers
2k
views
Difference between Site.forgotPassword() and System.resetPassword()
For a while now our community portal has been having regular yet inconsistent issues with users trying to request a password reset. We have a password reset link exposed which behind the scenes calls …
0
votes
1
answer
2k
views
How to create a selectlist populated by records that list lookup relationship records?
I have been stuck on this problem for days. Basically I have a select list populated by all records in the custom object "Sprint__c". When I select a record in that select list, I am trying to list al …
2
votes
0
answers
2k
views
"Connection reset" exception when sending a callout (HTTP.send())
We have been receiving this intermittent exception when trying to make a callout for a few months now ("Connection reset" is the exception message):
Connection reset Class.Sip_HttpUtil.callout: li …
1
vote
2
answers
871
views
Does an update called in an @future method count as being in the same transaction as the met...
I am on occasion seeing a "You have uncommitted work pending. Please commit or rollback before calling out" error during a sequence of callouts that are part of the same transaction. So basically the …
3
votes
2
answers
2k
views
Dynamic method to take in a list of sObjects, cast and loop through them and perform field l...
We currently have 2 different classes of code doing essentially the same thing on both the lead and account objects- grab the country and postal code and assign a territory. We are looking to combine …
0
votes
1
answer
2k
views
Executing a batch class based on the class name or id entered in as a string or id
I am creating a page in Salesforce that lists all our batch classes and will allow you to execute each one individually.
Basically I am querying every ApexClass, finding the batchable ones, and creat …