Tag Info

Hot answers tagged

7

If fetching of item["ID"] instead of 'Title' works AND If you are using the SPQuery object. Then, include the columns that you want to fetch in the ViewFields property of SPQuery. This will resolve your issue. Reference: ...


6

For a client solution I would use the Search REST API. The grouping has to be done on the client, it depends on how you configure your Managed Properties. The trick with People is to pass the correct Result Source ID in the query: For example: ...


6

Here are few more differences between Timer Job and Windows Task schedulers: Timer Jobs Timer jobs require downtime to deploy. Control via Central Admin. Schedule of Timer Job will be backed up and restore in your normal process of SharePoint backup and restore. Can be deployed using standard WSP solution. Custom Timer Jobs provides the power to specify ...


5

I like Arsalan's answer, however MS is pushing people to avoid server side development, which includes Timer Jobs. As timer jobs run on the SharePoint server, a poorly written timer job can have a negative impact on the farm. Also, if a customer ever moves to Office 365, any custom timer jobs will have to be re-written. An app run by the windows task ...


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

Make sure you reset the Timer service for SharePoint after your deploy to force it to pick up your updates: In PowerShell: net stop SPTimerV4 net start SPTimerV4


3

In order to execute RunNow method Farm Administrator rights are required. When you use RunWithElevatedPrivileges method, the code runs in the context of application pool account, which usually does not have farm admin rights (and it should not have it according to best practices) So the solution is to run the code in context of some user that does have farm ...


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 ...


3

You could try stroring the site url in timerjob properties collection and retrieve it in the Execute method of timerjob In the feature activated event store the siteUrl string key = "mySiteUrl"; string value = web.Url; TimerJob tmrJob = new TimerJob(webApp); //remove the key if already exists bool isKeyExists = tmrJob.Properties.ContainsKey(key); if ...


3

Have you tried viewing logs with ULS viewer? I think your problem might be that you are using SPContext.Current in a timer job.


3

Yes you should be able to deploy the timer job using the old WSP and it should work properly for sites in SP 2010 mode. However, as is expected if you need it in SP 2013 sites then you will have to update the WSP to be in conformance with SP 2013.


3

Our operations team says when you have a task that is really related to SharePoint, maybe list items iteration, logging etc etc. you should use Timer Job.. But if you have tasks not related to SharePoint at all or directly.. Than use Task Scheduler.. Example, we had an External Content Type made from SQL Server Database and the user wanted to iterate ...


3

Benefits of Sharepoint Timer jobs over Windows Task Scheduler are : Single point of failure : Windows Task Scheduler need to be configured on all the web servers. If you configure to run the job on 1 server only, and this server crashes, job will not work at all. Status Reporting : Windows Task Scheduler doesn't have any reporting on when was the last time ...


3

For every web application you can do the following: Get your timer job definition (SPJobDefinition) from SPWebApplication.JobDefinitions Get the guid: string jobDefID = SPJobDefinition.Id.ToString(); Add the guid in the query string http://srvr/_admin/JobEdit.aspx?JobId=jobDefID


3

You can create a "remote event receiver", where O365 calls your service that is hosted on your machine when an event occurs. So, if an announcement is added to a list, for example, O365 would call a WCF service that you registered for that event. That WCF service could be running on an IIS box in your own data center. The only difficulty with this is that MS ...


2

I suggest you to use google... http://www.codeproject.com/Tips/634208/Create-and-Deploy-Custom-Timer-Job-Definition-in-S Basically make a TimerJob in Visualstudio, write your code there and let this job run once a day. Code: get list check if an item hasn't been modified since 365 days. move to other list


2

One thing to remember when you are using site-scoped or site collection–scoped Features to install the timer jobs: The account that does the scheduling must have write permissions to the configuration database of the server farm. Usually, the identity of the application pool that is hosting the SharePoint site does not have permissions on the configuration ...


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 ...


2

Did you remember to restart the SharePoint Timer Service (in services)? It caches the DLL files


2

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 ...


2

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 ...


2

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


2

You should get site url as below. string siteUrl = this.Properties["SiteURL"].ToString(); and use below code to get current web in timerjob. using (SPSite site = new SPSite(siteUrl)) { using (SPWeb CurrentWeb = site.OpenWeb()) { // Write code here } }


2

I vaguely remember encountering something like this in the past, and whilst the details escape me, I think that adding the -Force parameter to Install-SPSolution resolved the issue. I think this was in relation to features rather than timer jobs, but it might be a starting point.


1

Here is how you get SPServiceContext: public void UserProfileSample() { //get current service context string websiteUrl = "http://SampleName"; SPSite site = new SPSite(strUrl); SPServiceContext serviceContext = SPServiceContext.GetContext(site); //initialize user profile config manager object UserProfileManager upm = new ...


1

When the instance of job definition is created it ID property is initialized via base SPPersistedObject constructor to Guid.NewGuid() : protected SPPersistedObject(string name, SPPersistedObject parent) : this(name, parent, Guid.NewGuid()) { }


1

Since all SharePoint timer jobs are inheriting Microsoft.SharePoint.Administration.SPJobDefinition which inherits SPPersistedObject, these timer jobs are written in the Hierarchical Object Store which is directly in the SPFarm database. Here is some more information about the previous sentence. Anyway, the point is that your context is important when ...


1

Hi i was able to acheive the same by following the below url. Hope it may help for some one (http://adicodes.com/timer-job-in-sharepoint-for-specific-site/). Below is my code how i have acheive it. ** CS file ** using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using ...


1

If you look through the job definitions and schedule you will see that the server is busy managing 100s of jobs an hour. These are meant to run pretty quick. When doing large sets of workloads, its typically a better idea to use the timer job for the scheduling and management of the work, but move the work somewhere else. It might be better to perhaps ...



Only top voted, non community-wiki answers of a minimum length are eligible