Tag Info

New answers tagged

1

The content is stored in the content database. You can access them as if you were accessing list item columns (try the 'PublishingPageContent' column) or, in the case of inserted Web Parts, you can use the SPLimitedWebPartManager class You do this with the SPListItem object and not the SPFile object.


0

Thanks for all the replies. As i found that my code was right I started looking for some administrative aspect of the apps. One of my colleagues pointed out that the Provider hosted apps need some specific permisssions set. I went to the Appmanifest.xml file and then I added this code. <AppPermissionRequests> <AppPermissionRequest ...


0

Your are doing correct but instead of this code ClientOM.FileCollection fcollection = folder.Files; clientContext.Load(folder.Files); clientContext.ExecuteQuery(); Response.Write("\n Files count: " + folder.Files.Count); foreach (ClientOM.File f in folder.Files) { Response.Write(f.Title); } Try ...


0

I don't know about the lookup field but for date field you can write this way: <Row> <Field Name="Id">1</Field> <Field Name="Date">2011-12-30T21:00:00Z</Field> </Row> Refer this discussion for more details.


0

Use following code: private static void DeleteUserFromList(SPUser userDeleted, string fieldName, SPListItem item, SPWeb sPWeb) { SPFieldUserValueCollection Users = (SPFieldUserValueCollection)item[fieldName]; SPFieldUserValue DeletedUserValue = Users.First(u => u.LookupId == userDeleted.ID); Users.Remove(DeletedUserValue); item[fieldName] ...


0

At the end I used this code to impersonate current user to local web service: try { Guid siteid = SPContext.Current.Site.ID; Guid webid = SPContext.Current.Web.ID; using (SPSecurityContext.GetWindowsIdentity().Impersonate()) { Label1.Text = WindowsIdentity.GetCurrent().Name; SOAPService ws = new SOAPService() { ...


0

I haven't known SharePoint provide or not, but in my opinion you can get this in two ways: First of all you need to write CAML query and do many groupby, stuff... like in SQL The second, get all item of the list and use algorithm to detect and get the unique item.


1

I found a solution to the original problem that was posted here, it took me whole day struggling with xml returned by query. Solution is, In ViewFields, terminate the internal name up to 32 charachters. And then, while getting value, use the internal name terminated up to 32 chars. This is definately poorly tested code by Microsoft pushed in SP 2010. ...


2

If you're using an UpdatePanel on your web part, make sure any RegisterClientScriptBlock calls on controls within that UpdatePanel use the UpdatePanel as the control parameter, rather than 'this' - I.E.: ScriptManager.RegisterClientScriptBlock(updatePanel, updatePanel.GetType(), UniqueID, "CloseAddDialog();", true); I have changed my code as above for ...


0

Well I achieved what I wanna do through this => Implementiong custom aspx Workflow Task. Hope this will be helpful to someone.


0

You can existing site column using powershell: $site = Get-SPSite -Identity "http://serverName:4001/" $web = $site.RootWeb $field=$web.Fields["Custom Site Column"] $field.Type= "Choice" $field.Update($true) $web.Dispose() $site.Dispose() But i think is the good practice as Joseph mention above is to create a content type which inherits from the issue ...


2

I would create a new content type that inherits from the issue content type. You could then remove and use the fields you need from issue content type. The created modified fields are system fields. These are usually defined in the base type item. http://msdn.microsoft.com/en-us/library/office/ms472236(v=office.14).aspx


1

This is your generated assembly, all you need to do is update the workflow and then use Update-SPSoution. SharePoint will know to use old assemblies for workflows that are still running on the old workflow after you update. Whenever you update a workflow as a solution, it will use the new version first, but keep the old version if there are any running.


1

If you already know the URL while opening the dialog and you open the dialog yourself, then you could use the dialogReturnValueCallback: http://msdn.microsoft.com/en-us/library/office/ff410058(v=office.14).aspx If you cannot open the dialog yourself, you might have a chance to render some JavaScript on the page onto which you redirect (within the dialog)? ...


0

check-out then check-in the page layout and the master pages , and i publish them as majot verisons and now the page layout is working well. –


0

Read this list_properties http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list_properties%28v=office.15%29.aspx list.enablemoderation http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list.enablemoderation%28v=office.15%29.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1


1

The difference is in "authentication mode" settings. Windows authentication provides real windows user and then this would allow us to make resource requests from ASP.NET while impersonating the Windows identity of whoever was logged on. With forms authentication ASP.NET itself makes requests for system resources using the Application Pool account. Look ...


2

I think the way you are going about the whole process of hiding fields based on group is completely mislead. Hiding a field will hide the field for the entire list and for everyone. What you are working with is only a view. You can create a new view that will filter out fields based on group membership, but you will be using CSOM and javascript rather than ...


0

explore this code chunk and see if it works for you - HttpSessionState fooState = HttpContext.Current.Session; HttpContext.Current.Response.Write(fooState.SessionID);


3

Yet another version to load List by server relative Url using CSOM. The solution consists of the following steps: Retrieve list Folder object using Web.GetFolderByServerRelativeUrl method Retrieve List by specifying List ID stored in vti_listname property from Folder.Properties object Code: static class WebExtensions { /// <summary> /// ...


5

This seems to be pretty close in performance: context.Load(lists, all => all .Where(l => l.RootFolder.Name == "MyListUrl") .Include(l => l.Id)); context.ExecuteQuery(); list = lists.Single(); If you need to get this by server-relative url you would need to parse the web url and list url first.


1

try using the below script in CEWP: <a onclick="modalcall()" href="#">Add New Item</a><script type="text/javascript"> function modalcall() { SP.UI.ModalDialog.showModalDialog({ url: "NewForm.aspx", title: "New Item", //allowMaximize: true, //showClose: true, dialogReturnValueCallback: ...


0

your code doesnt show anything todo with the timer itself, just adding some data to cell... 1) bind the list through your code to a table or what ever container your using, like splistview: http://www.codeproject.com/Articles/42399/DataBinding-to-SPListItemCollection 2) now create the timer on the page within code behind to refresh the page x ammount of ...


-2

You can look at Share .NET, a component for .NET that makes it easy to use SharePoint REST API with .NET / Mono.


1

Per the ULS, no cache hosts are present. So either Distributed Cache is simply stopped on a server, and you'll want to start it via Manage Services on Server, or you don't have one, and you'll want to issue Add-SPDistributedCacheServiceInstance. You will also want to apply AppFabric CU5 and edit the config file per the KB for AppFabric CU3.


0

You can get workflow as: if (item != null && item.Workflows != null && item.Workflows.Count > 0) { try { var workflows = site.WorkflowManager.GetItemActiveWorkflows(item); foreach (SPWorkflow workflow in workflows) { // match on some indentifiable attribute of your custom workflow // ...


0

actually nothing wrong with the code, but it could be the authorization or authentication issues, as described in some forums. Try: context.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; or try adding domain in the parameter: var credentials = new NetworkCredential("theusernameonly", "thepassword", "thedomain"); Hope it helps... ...


1

I did that before, but it was for Sharepoint 2010 (see my blog post). The code I used is the one below. It must be inserted into your masterpage, just before the </head> tag : <script type="text/javascript"> function DefaultUploadOverwriteOff() { if (document.title.indexOf("Upload Document") > -1) { var ...


0

Use the Script Editor web part and include the below script on EditForm.aspx library file: <script type="text/javascript"> _spBodyOnLoadFunctionNames.push("Redirect"); function Redirect() { var mode = getURLParam('Mode'); /* var sourceURL = getURLParam('Source'); var properSourceURL = replaceCharacters(sourceURL); */ if ...


0

I think uncheking the chekbox will solve all your problem. As if this checkbox is unchecked then user uploading duplicate file will get error about same name of file. And for unchecking the chechbox, see below comments. Writing a javascript directly on upload.aspx file present in layouts/15 folder, but this is not recommended. So in that case you can ...


0

Yes there is Microsoft.SharePoint API used, using below c# code you can connect to SharePoint root site: SPContext.Current.Site.URL For subsites you can use the below code: SPContext.Current.Web.URL For ClientContext use the below code: ClientContext context = new ClientContext("https://mycompany.sharepoint.com/sites/parts/"); ...


0

I'm not sure what exactly you are looking for in C#, a site or web in sharepoint can be accesses via these codes given below: SPSite site=new SPSite('Site url"); SPWeb web=site.OpenAllWebs(); string userName = web.CurrentUser.LoginName;


1

There are several ways you can achieve it. It depends on how many users you will have accessing the list. On several occasions, I create lists where only a single manager will be accessing the page. Instead of creating separate views, you can control access based on the username. You can encapsulate the manager only data fields in a section. You will ...


0

You can use javascript/Jquery to hide control in editform page of list. Whenever user edit an item, hide manager's related field. User querystring and read it to make manager's related field visible. As you may be sending url to your manager in email, include querystring in that url so that only manager related field are visible while rest of fields were ...


1

you can try with a approach using custom visual web part where you can show/hide and enable/disable the controls depending on the user permissions (Users,Managers Group) and attach a workflow or c# code for sending the email notification to Manager maintaining a flag on the list item action. 1) Create a custom web part. 2) Add the web part on your edit ...



Top 50 recent answers are included