我在 sharepoint 中创建了一个计时器作业,并且已经做得很远了。我遇到了在静态方法中有一个“this”对象的问题。这是我的代码。如果有人有任何建议,那就太好了。
public static SPListItemCollection GetRecordwithMissingData (string DocType, string DocName)
{
//Access associate ID and Doc Name
//SPWeb web = properties.Feature.Parent as SPWeb;
SPWebApplication webapp = this.Parent as SPWebApplication;
SPSite hrdocsSite = webapp.Sites["sites/HRDOCS/HRDocuments"];
SPWeb rootweb = hrdocsSite.RootWeb;
SPList AssociateDocumentsList = rootweb.Lists["Associate Documents"];
SPListItemCollection AssociateDocuments = AssociateDocumentsList.GetItems("ID", "PrimaryName", "DocName", "Document Type");
// stores Associate Documents ^