Hot answers tagged custom-timer-job
4
The chosen language cannot be the reason why your job doesn't work. Regardless of language it compiles in the same MSIL. Did you check ULS for any errors related to your job? Did you check ULS settings - maybe it configured not to log some messages? Did you check job status in Central Administration?
3
There are two key points to the Timer Job. The class which represents the timer job, and then the code that actually registers the job. This is typically done within a feature receiver on the feature that contains the timer job.
Here is some code on MSDN: http://msdn.microsoft.com/en-us/library/cc406686.aspx#WSSCustomTimerJobs_DeployingCustomTimerJobs
...
3
I think you have only deployed the solution (wsp) file of the timer job. You will also need to activate the feature for your timer job.
Go to the Site collection features of your Web-application and Activate your timer job feature from there.
This should start showing your timer job in the list of Job Definitions in the Central Administration.
I hope this ...
2
When a timer job instance is created, it is persisted to the farm configuration database. Accessing this database for write purposes is a privileged operation; as a rule of thumb, only the farm service account (that is, the account under which OWSTIMER.EXE executes) or accounts that explicitly have the rights. So application pool account wouldn't work, as ...
1
A timer job that runs in the context of a web app (which is one of the two options (and the simplest)) has full access to the entire web app.
You you have to do to access a sub-site's list is refer to the site it is in, then find the subsite and finally the list.
Getting a site from a web app:
SPSite site = webApp.Sites[SiteName]
Setting a sub site ...
1
Make sure you delete the job in your feature activation in addition to stopping and starting the timer job. According to Microsoft documentation you must delete the job in your feature deactivation before it is re-added.
http://msdn.microsoft.com/en-us/library/hh528519(v=office.14).aspx
C#
public override void FeatureActivated(
...
1
The OWSTIMER doesn't run in a web context and does not have immediate access to your web application web.config files.
You can use something like this tutorial to read web.config values from your web apps: http://praveenbattula.blogspot.com/2009/12/access-webconfig-in-sharepoint-timer.html
You can also create an app.config file right next to the ...
1
I have been developing timer job for quiet a while now and always created myself a Event log specially for timer job to log when it started or stopped and also if there is any error came up while execution.
I use this code to write messages to event log you can also add code to send an email to a specific user in case of error if you would like to,
private ...
1
You could have the timer job create an item with a column holding the user name (ideally in a hidden list or maybe add a column to the users list ?)
Then you can create a delegate control or a small javascript wich checks if the current user is on that list and if the is has been created less than 5 days ago, if yes then show popup.
1
One thing I've found with CAML (and this may or may not actually help you here) is that true != TRUE and false != FALSE. I've been burned by that before. Use all caps there.
Also, fieldRef should be FieldRef.
So the CAML to try would be:
"<Where>" +
"<Gt>" +
"<FieldRef Name='myDate'/>" +
"<Value Type='DateTime' ...
1
Could you debug the timer job locally in your dev enviornment. Remember to restart the timer service in your dev enviornment before you attach to the owstimer service from Visual Studio.
If you can successfully attach and debug locally ensure the url to the site and list are the same in your UAT/PROD enviornment.
Hope this helps
1
It's all about in the way you construct your Feature receiver. Simply create a Web Application scoped feature, which is automatically activated (set this in VS already in the Properties window). In this you would put something like that:
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
//Add code to check whether it is already added ...
1
1) You don't use .webpart files for timer jobs
2) You don't copy any DLLs anywhere, you would use WSPs to deploy your solution
3) WSP deployment will register the DLL in the GAC. VS2010 has tokens to get the PublicKeyToken. Scope of the Feature depends on where you want the Timer Job to be created. It's usually Web Application
4) This isn't a web part, ...
1
(i:0#.f|admembership|user) This was the correct answer for me. We had a FBA Ldap provider and custom login page working in our SharePoint 2007 enviroment. We upgraded to SharePoint 2010 and had to make to conversion from Windows to Claims based authentication. Claims adds the prefix of i:0#.f|admembership to all our FBA Ldap member usernames, I just had to ...
1
"What is strange is that the newsletter is still being received by one
recipient, who is using an email address with our company domain."
Are some of the email addresses outside your domain? SMTP Servers can have different rules for what they will do with internal and external addresses.
I would start by using an SMTP Test tool (you can also use ...
1
Try to remove/retract everything, even the assembly folder you mentioned. Instead of using the SharePoint tokens in VS (receiverAssembly="$SharePoint.Project.AssemblyFullName$" receiverClass="$SharePoint.Type.48312723-bcb8-45ab-8701-8800016a158a.FullName$") make them 'hard coded', just to make sure you have the correct fully qualified name, namespace, class, ...
1
The short answer is yes, a custom timer job can access sql server. However in order to work out what your problem is, you'll probably need to provide us with more information. For example you may have an issue with your connection string, permissions on the database you are trying to access etc.
Only top voted, non community-wiki answers of a minimum length are eligible

