moss

webservice oneway and new SPSite(myUrl)

旧城冷巷雨未停 提交于 2020-01-24 22:04:26
问题 I have a problem with a oneway web method that open a moss site (probably because in a oneway webmethod the context is null) Is possible to rewrite this code to remove the null reference exception? (without the oneway attribute i don't have the exception) [SoapDocumentMethod(OneWay = true)] [WebMethod(Description = "TestOneWay")] public voidTestOneWay(string webUrl) { using (SPSite site = new SPSite(webUrl)) { .... } } the exception is: [2304] Error:Object reference not set to an instance of

Get username from SharePoint User field in List

本小妞迷上赌 提交于 2020-01-22 10:05:02
问题 I have a custom sharepoint workflow that I'm developing in Visual Studio. The workflow is running against a document library which has a custom content type connected to it. The content type includes a user lookup field ("owner"). I'm trying to have my workflow assign a task to the "owner" lookup field. However, I've only been able to get the display name for the user, not the account username. Can anyone help? 回答1: Refer to this Article on how to get the User Details from the Field. public

Get username from SharePoint User field in List

橙三吉。 提交于 2020-01-22 10:04:46
问题 I have a custom sharepoint workflow that I'm developing in Visual Studio. The workflow is running against a document library which has a custom content type connected to it. The content type includes a user lookup field ("owner"). I'm trying to have my workflow assign a task to the "owner" lookup field. However, I've only been able to get the display name for the user, not the account username. Can anyone help? 回答1: Refer to this Article on how to get the User Details from the Field. public

SharePoint 2007 : Get all list items in a list regardless of view from web service?

一世执手 提交于 2020-01-15 09:44:09
问题 I need to check for duplicates. Currently I have items stored in sub folders in a list. How can I retrieve all items in the list from a web service, so I can check for duplicates? Here is code from object model: I want to do exactly this, but from a web service private static void PrintItemTitles() { string strUrl = "http://localhost:8099/"; using (SPSite site = new SPSite(strUrl)) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["MyList"]; SPListItemCollection items = list

Create Feature to Upload Site Template File (.stp) in MOSS

别来无恙 提交于 2020-01-15 06:09:10
问题 Following on from this question, I have created a feature to upload an site template file as part of an automated build of a SharePoint site. However, while the feature deploys the .stp file correctly to the hive, and the solution appears in the CAS | Operations | Solution Management page, the site template does not appear in the site template gallery as expected. I have given the contents of the feature.xml and elements.xml files below; can anyone spot where I am going wrong? feature.xml <

Sharepoint “Could not load file or assembly” “The system cannot find the file specified”

瘦欲@ 提交于 2020-01-14 07:47:07
问题 I have added a reference to a dll (sharpPDF) to my .net project. In the code it has picked up the dll and I can use it. When I deploy by sharepoint webpart i get the following error: Could not load file or assembly 'sharpPDF, Version=1.0.3511.18105, Culture=neutral, PublicKeyToken=f099e668beaaa0f9' or one of its dependencies. The system cannot find the file specified. I am deploying the webapp by using STSDEV. I have tried clearing out C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary

How do you instruct a SharePoint Farm to run a Timer Job on a specific server?

左心房为你撑大大i 提交于 2020-01-13 09:42:51
问题 We have an SP timer job that was running fine for quite a while. Recently the admins enlisted another server into the farm, and consequently SharePoint decided to start running this timer job on this other server. The problem is the server does not have all the dependencies installed (i.e., Oracle) on it and so the job is failing. I'm just looking for the path of least resistance here. My question is there a way to force a timer job to run on the server you want it to? [Edit] If I can do it

WSS GetListItems Not Returning Folders without Inherited Permissions when Calling with GUID

我与影子孤独终老i 提交于 2020-01-06 16:33:27
问题 WSS 3.0 List Service I am running GetListItems() on a Picture Library (name Pictures) using the follow CAML query: <Query> </Query> <ViewFields> <FieldRef Name="EncodedAbsUrl"/> <FieldRef Name="Title"/> <FieldRef Name="ContentType"/> </ViewFields> <QueryOptions> <Folder>Pictures\Uploads</Folder> <ViewAttributes Scope="RecursiveAll"/> </QueryOptions> This query correctly returns all files and folders in the Uploads folder. However, if I navigate to the Uploads folder and select Edit

Sharepoint features, custom aspx pages at various site levels

↘锁芯ラ 提交于 2020-01-06 08:16:30
问题 I've asked a similar sort of question here but what to be more specific. I want to be able to deploy a solution and activate a feature that provisions various custom aspx pages to different site levels within my web site. So my first custom aspx page would be at the root: http://example.org/custompage1.aspx And then another custom aspx page would appear at a deeper level: http://example.org/subsite1/custompage2.aspx I've got my solution scoped to the "web" level. If I activate the feature at

How to show Failed status in Sharepoint Timer Job

筅森魡賤 提交于 2020-01-05 06:06:05
问题 I want my timer job to display failed status on certain condition. Should I just throw an exception or what? 回答1: Hasan, If an exception bubbles out of the code, it will indeed show a failed status. If you want to explicitly "fail" your run with the timer job instance, you can and should throw an exception out. This can be done in conjunction with setting the SPJobDefinition.Retry flag value to TRUE if you feel that another run through would get around your "problem condition." By the same