Hi,
I call
timerjob.RunNow()
from user control,then i got exception for this line:
ListArchiveJob objlistArchieve = (ListArchiveJob)site.WebApplication.JobDefinitions.FirstOrDefault(thisJob => thisJob.Name.Equals(timerJobName));
objlistArchieve.RunNow();
Exceeption Details:
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)). Stack Trace : at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bPreserveItemUIVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish, String bstrFileName, ISP2DSafeArrayWriter pListDataValidationCallback, ISP2DSafeArrayWriter pRestrictInsertCallback, ISP2DSafeArrayWriter pUniqueFieldCallback) at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean b... c5c40174-26a4-44f7-8981-5e3ce1da983b
Add, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents, String filename, Boolean bPreserveItemUIVersion) at Microsoft.SharePoint.SPListItem.SystemUpdate() at CyberStreams.ListArchive.ListArchiveConfigurer.ListArchiveConfigurerUserControl.<>c__DisplayClassc.b__b() at Micro... c5c40174-26a4-44f7-8981-5e3ce1da983b
soft.SharePoint.SPSecurity.<>c__DisplayClass4.b__2() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at CyberStreams.ListArchive.ListArchiveConfigurer.ListArchiveConfigurerUserControl.createList() at CyberStreams.ListArchive.ListArchiveConfigurer.ListArchiveConfigurerUserControl.buttonArchieveDates(String startDate, String endDate, Int32 checkYearBegin, Int32 checkYearEnd) at CyberStreams.ListArchive.ListArchiveConfigurer.ListArchiveConfigurerUserControl.btnDates_Click(Object sender, EventArgs e) c5c40174-26a4-44f7-8981-5e3ce1da983b
Thanks,
Rajendhiran M