Questions tagged [scheduled-apex]

Issues with writing, running, or testing scheduled Apex code, using the Schedulable interface.

Filter by
Sorted by
Tagged with
-3
votes
1answer
2k views

How can i schedule a apex job on Daily basis using "Schedule Apex" button under Develop->Apex Classes section [closed]

I want to schedule a job on daily basis so can anyone explain how can i do that using UI option? I don't want to do that using code. I just want to use "Schedule Apex" option available under App Setup ...
10
votes
1answer
19k views

When do Sessions expire?

I note that Session Settings allows you to have sessions expire as often as low as 15 minutes. However, I believe this is related to browser sessions and sure enough they do time out as expected. ...
3
votes
1answer
2k views

Need an efficient way to support ranking mechanism in Salesforce

On the case object, i have a numeric score field which gets populated using before insert/update trigger and based on few fields selected on case. Now the requirement is to give a rank number to each ...
0
votes
1answer
926 views

Automatically update a field based off of data from another field

Here's the scenario, we sell a Lite and Pro version of our product and a customer already has the Lite version and the fields on their account are filled out as shown below. Product: Lite Go Live ...
3
votes
1answer
788 views

Birthday Chatter Post

I need to create a post with a message of happy birthday when it's the birthday of a user. I have seen the code to create the post but I don't know how when to run it. Should I write a trigger? ...
2
votes
1answer
468 views

Schedule task 10 minutes after install

I have a schedulable class in my package that would run every hour to pull data using a callout and put it in the custom object. I am aware of using system.schedule as below: String scheduleTime='0 '...
3
votes
1answer
2k views

Changing time of schedule task

I have a schedule task configured in force.com. I want to change the time it runs. I go to set up / monitoring / schedule jobs. But I only see the option to delete it. Is there any to make a change ...
7
votes
1answer
6k views

Is anyone using classes in anonymous apex?

I can't find anyone writing about this, but this works when executed anonymously: public class foo { public void bar() { system.debug('\n\n#### FOO BAR ####\n\n'); } } foo f = new foo(...
7
votes
1answer
791 views

Are scheduled apex jobs allowed in Group and Professional Editions via ISV program

I'm building out a managed package via the ISV program which will run inside GE/PE. I know that you can get APEX classes into GE/PE via the managed package, but can you schedule these apex classes? ...
3
votes
1answer
253 views

Error in inserting a sobject in batch apex and passing the same object in webservice call

i need to Insert a List of Sobject Pass the ID of SObject that has been inserted in to a webservice call. This has to be done in Batch Apex since it needs to run on a daily basis. Now i have done ...
3
votes
2answers
986 views

How to change or set the Crontrigger OwnerId?

Is there any way to change or set the crontrigger ownerId? I started an Apex Job in a Post Install Script and the ownerId is the installed package. I need change it or abort the job and start it again ...
3
votes
1answer
146 views

Do governor limits changes for schedulable tasks?

I have a scheduled task which reads data and then sends out an email. In some cases the data returned can be very large and I am wondering if I need to make this a batch job or not. Basically what ...
4
votes
2answers
2k views

Setting up a schedule task

I have set up a schedule task as per instructions here: To turn the scheduling on, I open a dev console and do: MY_NS.MyScheduleTask = new MY_NS.MyScheduleTask (); String sch = '35 27 15 1 3 ?'; ...
6
votes
1answer
1k views

Permissions to execute System.abortJob() method

What permissions does user need to call System.abortJob() in Apex? When the method is called this error is displayed: System.SecurityException: Insufficient Privileges. Thanks.
2
votes
1answer
3k views

How to Automate Translation

We need a way to copy English translations of picklist labels into other languages. Given a picklist on the Opportunity object with values Y and N translated as follows: Value EN_us DE ...
0
votes
2answers
3k views

How to send Weekly Email to email-fields of records?

I have rejected Workflow Rules, since email alerts can't be sent at the exact same time every week. I have rejected schedulable Reports/Dashboards since emails can't be sent to email fields of records ...
1
vote
1answer
2k views

Apex example Code to copy Account field values

I am new to SalesForce. My goal is to create a scheduled Apex function that runs once all 24hours that just copies Account.Field("field1").Value to Account.Field("field2").Value. Is there a good ...
8
votes
1answer
5k views

How to delete 10K records in Salesforce via Apex?

This question might be more towards the approach than the technical side. The scenario is the following: I have to run a scheduler to delete some records. The record size is always going to be less ...
3
votes
1answer
178 views

Too many script statements (in a patch org only - OK in dev org)

I have a schedulable class in my managed application. (I feel that some of the code I am about to discuss is not good code so in my defence I want to clarify that I did not write this code - I just ...
42
votes
4answers
20k views

Scheduled reports as attachment

Is there any workaround to send out scheduled reports as Excel attachment than actually embedding it within an email? Salesforce scheduled reports embeds the report in email making further drill down ...
0
votes
1answer
3k views

Best approach for sending daily email reminders

I use scheduler + batch apex + Messaging.SingleEmailMessage to send out reminder emails every 2 weeks to a specific set of users in a public group!!! Is this a decent approach/ is there any other ...
7
votes
1answer
3k views

Salesforce timezone issue

Hi guys we have a problem with DST (Daylight Saving time) We show the time in a Visual Force interface according to the time zone of the logged in user. However in the Salesforce objects we are ...
1
vote
1answer
4k views

Time-based Trigger to update all records

If I want to "touch" (save, update) all records once a morning in an object (let's use Account as the example, though it would more likely be in a Custom object), how would someone go about that? To ...
28
votes
3answers
18k views

Scheduling an Apex Job through the ui

I am not sure if my memory is failing me, but I was sure there was a way to schedule an Apex Job through the Salesforce UI. The documentation here only makes mention of using the cron syntax. and ...
7
votes
2answers
2k views

Receive this error from installed package 'System.QueryException: sObject type 'CollaborationGroup' is not supported.'

I am getting the error - 'System.QueryException: sObject type 'CollaborationGroup' is not supported.' When running the following code as part of a managed package by scheduled apex: List groups =...
6
votes
1answer
2k views

calling the system.schedule method in a generic context

I am trying to call the system.schedule method in a generic manner to help avoid scheduled job naming confusion like so: // Set my schedulable class to run. private String setMyClassRunning(String ...
8
votes
3answers
4k views

Schedule apex class to run every minute as there can only be 5 batch jobs

I have a need to execute the Apex class every minute. I have a Sites VF page and in that I have link called "Export to Excel" which exports bulk data (say 50000 records of my wrapper class type) ...
2
votes
1answer
299 views

How to release the a lock on Apex Class from Scheduled Job

Is there a way to release a "lock" on an Apex class after the scheduled job that was using that class has been deleted? For some reason, this "lock" is still active and is preventing me from ...
36
votes
2answers
4k views

Ghost Schedulable Classes Blocking Deployment

Recently I've been running into issues where deployments were blocked due to a Schedulable job pending or in progress when I'd already cleared the Schedulable job from that class. Any tips for ...
11
votes
5answers
3k views

Are there best practices to get scheduled apex scheduled to run faster than once per hour?

When trying to set up a schedule to run every 5 minutes I got an error that seemed to indicate that you can't schedule apex to run every X minutes or every Y seconds. It appears the fastest you can go ...
3
votes
3answers
337 views

API Limits Exception

We have a customer whom is hitting API limits in their org: More than 50,000 API call per-day. They're trying to isolate an installed package that might be to blame, and the only thing they've given ...

1
13 14 15 16
17