Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all 25064 articles
Browse latest View live

“DTD is prohibited” error when accessing sharepoint 2013/office365 list (but not openly aware of using XML)

$
0
0

I've been getting a list of folders and files from Sharepoint (on Office 365) by using the following C# code...

...
var folders = ListFolders(libraryName, clientContext, web);
...    

public List<Folder> ListFolders(string libraryName, ClientContext clientContext, Web web)
{
    var list = GetDocumentLibrary(libraryName, clientContext, web);    var folders = list.RootFolder.Folders;    clientContext.Load(folders);    clientContext.ExecuteQuery();    return folders.ToList();        
}    

public List GetDocumentLibrary(string libraryName, ClientContext clientContext, Web web)
{
    var query = clientContext.LoadQuery(web.Lists.Where(p => p.Title == libraryName));   clientContext.ExecuteQuery();
    return query.FirstOrDefault();
}


It was working fine until I rebooted my computer (it installed a Windows Update), I strongly suspect, based on some testing I've done, it is caused by http://support.microsoft.com/kb/2964358 

When the *clientContext.ExecuteQuery()* statement is reached in *GetDocumentLibrary()*, the
following exception is thrown.

*An unhandled exception of type 'System.Xml.XmlException' occurred in System.Xml.dll
Additional information: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.*

I'm wondering how I can work around this, as I'm not consciously using System.XML, it's a background function or process when the ExecuteQuery runs. 

Can I pass some additional XMLReader info to this or clientContext (I'm assuming not), so I'm not sure how to execute this query to prevent the DTD error. I have also tried accessing the list in a different manner, by using this code... (from Microsoft's MSDN pages)

List list = clientContext.Web.Lists.GetByTitle(libraryName);

CamlQuery camlQuery = new CamlQuery();           

camlQuery.ViewXml = "<View/>";

ListItemCollection listItems = list.GetItems(camlQuery);

clientContext.Load(list); clientContext.Load(listItems);

clientContext.ExecuteQuery();

This works on a computer without the KB above, however on my PC it doesn't (I get the same exception as my other code) , obviously uninstalling the KB will make things work in the short term, but its no good in the longer term. Any advice on how to avoid this error would be greatly appreciated.  I can only assume there will be a "preferred" way from Microsoft for accessing lists now this KB is implemented, but I'm clueless as to what it is.

Thanks
Dougie



Logging information from one SPlist to another

$
0
0

I am trying to create a list that takes the "Finished" items under the Status column of a list and copies the Title and "assigned to" details and adds these information into a new list. I came up with this code. But I keep getting these errors. I don't know why? It is a Feature in a SharePoint Empty Project

using System;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using Microsoft.SharePoint;

namespace LogFeature.Features.Feature1
{
    /// <summary>
    /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade.
    /// </summary>
    /// <remarks>
    /// The GUID attached to this class may be used during packaging and should not be modified.
    /// </remarks>

    [Guid("b07b7618-f139-464e-a15d-79e4f91b700d")]
    public class Feature1EventReceiver : SPFeatureReceiver
    {
        // Uncomment the method below to handle the event raised after a feature has been activated.

        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPSite oSite = properties.Feature.Parent as SPSite;
            SPWeb site = oSite.RootWeb;
            var list = site.Lists.TryGetList("Completed Task Log");
            if (list == null)
            {
                var listG = site.Lists.Add("Completed Task Log", "Last two weeks of completed tasks", SPListTemplateType.GenericList);
                list = site.Lists[listG];
                list.Fields.Add("Task", SPFieldType.Text, true);
                list.Fields.Add("Completed By", SPFieldType.Text, true);
                list.Fields.Add("Date", SPFieldType.DateTime, true);
                list.Update();
            }
            var newitem = list.Items.Add();
            var list2 = site.Lists["Today's Agenda"];
            SPListItemCollection lic = list2.GetItems("Status", "Assigned%5Fx0020%5FTo", "Title");
            for (int i = 0; i < lic.Count; i++)
            {
                SPListItem it = lic.GetItemById(i);
                if ((string)it["Status"] == "Finished")
                {
                    newitem["Task"] = (string)it["Title"];
                    //newitem["Completed By"] = (string)i["Assigned To"];
                    newitem["Date"] = DateTime.Now;
                } it.Delete();list.Update();
            }
            //SPListItemCollection lic1 = list.Items;
            //for (int i = 0; i < lic1.Count; i++)
            //{
            //    SPListItem ite = list.GetItemByIdSelectedFields(i, "Date");
            //    TimeSpan elapsed = DateTime.Now.Subtract((DateTime)ite["Date"]);
            //    double days = elapsed.TotalDays;
            //    if (days > 14)
            //    {
            //        ite.Delete();
            //    }
            //}
        }


        // Uncomment the method below to handle the event raised before a feature is deactivated.

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            SPSite oSite = properties.Feature.Parent as SPSite;
            SPWeb site = oSite.RootWeb;
            var list = site.Lists.TryGetList("Completed Task Log");
            if (list != null)
            {
                list.Delete();
            }
        }


        // Uncomment the method below to handle the event raised after a feature has been installed.

        //public override void FeatureInstalled(SPFeatureReceiverProperties properties)
        //{
        //}


        // Uncomment the method below to handle the event raised before a feature is uninstalled.

        //public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        //{
        //}

        // Uncomment the method below to handle the event raised when a feature is upgrading.

        //public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)
        //{
        //}
    }
}


Error1 Error occurred in deployment step 'Activate Features': Value does not fall within the expected range.
00LogFeature

How many web parts on one Wiki-page Sharepoint 2013

$
0
0
How many web parts can be placed on a wiki page? I tried 3 but that did not work.

sharepoint 2013 modal dailoge (application page) hide 'X' or close button

$
0
0

I wants to hide or remove 'X' (close button on top right) from SharePoint 2013 .aspx page which opens in modal dialoge.

I know how to pass false in showClose in Modal dialoge, but want close from application page using any way (C#/JS/CSS)

and in Application page added css to make .ms-dlgCloseBtnImg{ display:none;} to

and JQuery

alert($("a[title='Close dialog']").html());
alert($(".ms-dlgCloseBtnImg").html());
var oCloseButton = $("a[id^='DlgClose']",window.parent.document);
oCloseButton.hide();
alert(oCloseButton[0].html());
oCloseButton = $("a[title='Close dialog']",window.parent.document);
alert(oCloseButton);
oCloseButton.hide();

but no luck.

Any help appreciated.

Retreive Social Tags of Current User by using REST API

$
0
0

Hi All,

Just wondering if it is possible to retreive all tags and Notes Information of logged in user through  REST ? I know that we have SocialTagManager in Server Object Model, however I didnt find on how to retreive them through REST.

Thanks,

Yesh

Link to document not opening document in browser or client app

$
0
0

hi All,

i am using office 365 e1, i have aspx page on which we are fetching link of document and showing using CSOM. when user click on link instead of opening in client app or browser it is downloading. 

if you have solution please help me

Jquery mega menu in Sharepoint 2013 two rows overlap

$
0
0

I use the jquery mega menu in a SharePoint 2013 site. Because there are a lot of menu items I do get two rows of the menu. the two rows overlap a bit which does not look very nice. I tried some css tuning but that made it worse. I need a little help. can someone tell me which part of the css I need to tweak?

Thanks

How to create sharepoint 2010 workflow using sharepoint designer

$
0
0

Dear team,

How to create SharePoint 2010 workflow for approval process of template library  using share point designer 2013 


Workflow error - A response was returned that did not come from the Workflow Manager.

$
0
0

I am trying to add an item to a list whenever is document is added to a library with a custom contenttype flag set. My workflow is:
If CurrentItem:AuditorView = Yes
     Create Item in AVLinks (Output to Variable: create)

Transition to Stage
     Go to End of Workflow

I am trying to add a record with 3 fields:
URL Value: Workflow Context:Current Item URL
Site Value: <mysitename>
Library Value: <mylibraryname>

When running the Error checker prior to publishing, I get no errors, but, when trying to publish, I am getting the following error:

System.InvalidOperationException: Operation failed with error Microsoft.Workflow.Client.InternalServerException: A response was returned that did not come from the Workflow Manager. Status code = 500:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>500 - Internal server error.</title>
<style type="t

Nothing appears in the event log or ULS log with more information. All of the services and the app pool are running, and the Workflow Service Status shows Workflow is Connected.

Ideas?

How get the Task Parent of a Task Item from a SharePoint Task List using REST?

$
0
0

Hello

I'm using REST to get all fields from a Task Item in a SharePoint Task List.

http://sharepointdesa.aaa.bbb/_api/Web/Lists(guid'24024bd8-6d65-4e20-862c-d54d640d37fa')/Items(3)

In the JSON returned, there is not any field that correspond to the Parent Task (or Task Parent ID).

How can I get the Parent Task of a Task Item from a SharePoint Task List using REST?

This is a example of what I get in response to my REST JSON query to one of the child items in the SharePoint List.

https://farm3.staticflickr.com/2897/14830900795_a46cee340d_o.png

Thanks

Shareponint 2013 / Office 365

$
0
0

Hello,

I have developed a SharePointhostedappandwould like to knowhow to put aclientapppart inmasterpage, especially in the quicklauncharea. Or if not possible what can i do to put custom controls on the master of Sharepoint 2013 Server or Office 365

Thanks

Can someone tell me how to use ObjectSharingInformation.GetObjectSharingInformation to get AnonymousViewLink property

$
0
0

Hi,

I am successfully using ObjectSharingInformation.GetObjectSharingInformation to get AnonymousEditLink property but I can't figure out how to use the same function to get AnonymousViewLink property it is always coming out as null does anyone know how to get a value for this property?

Any help will be greatly appreciated.

User Profile Migration issues

$
0
0

I am facing strange problem while doing user profile service migration from SharePoint 2010 to SharePoint 2013.

I have used database attach process to upgrade from SP2010 to SP2013(http://technet.microsoft.com/en-us/library/jj729795(v=office.15).aspx), everything looks good except few fields data missing(like Skills, school).

I have verified in Database and data is exists but not showing in UI, when add new skills from UI it is showing back.

Any cmdlets to refresh skill suggestions

are they any known issues in this process ? 


S.Venkata Appaji





yahoo signout fails SharePoint 2013

$
0
0

We are using SPO and encountered this issue when trying to logout using Yahoo. The signout happens fine with all browsers, except for IE. Somehow, the cookie still persists for the user and the next time, the user can login without being challenged. We looked through fiddler and it seems that ADFS doesn't like the cookie and terminates the process abruptly.

Please note that document.execCommand('ClearAuthenticationCache') works for all browsers except IE. For IE we need to close the browser to terminate the session. This is not consistent with our requirement, where it should take us back to the login page as it's doing for all other browsers.


SharePoint Architect


Deploy Provider-hosted App

$
0
0

Hi,

I'm trying to deploy an Provider-hosted App on my SharePoint 2013 on premises. 

I followed all of the Microsoft best practices.

When I try to "trust it" my app, i get the following error (in the log file):

"Could not follow the url http://[url]/[MyAppName]".

Can someone help me?

Best regards


Not able to open SharePoint Designer 2013 Workflows in SharePoint Designer 2013

$
0
0

Hello,

I am working on client project where client IT team had created SharePoint 2010 and 2013 designer workflows using SharePoint Designer 2013. Now we have to do some enhancements in those workflows. The client application is SharePoint Online (Office 365). I have also confirmed with the customer that they have not used any other type of workflows. I am able to open SP 2010 workflows. Also, all 2010 & 2013 workflows are running properly on client site/application..But where I can see the business logic of that workflow ?? :( 

My Explorations - I tried installing/uninstalling SP Designer 2013, but that didn't worked. Also, I tried opening on different machines, that didn't worked too.Then I tried opening .xoml file in SP Designer 2013 , which got opened, however to edit/enhance the workflow as per the requirement, I need to see the existing workflow. ? .XOML are not readable..

Please suggest if anything else needs to be done (installed etc.) on my machine to view those workflows OR is there a different approach for the same ?


Vipul Jain

Design Decision for Workflow

What is the purpose of Microsoft.SharePoint.Runtime.dll in CSOM?

$
0
0
I know we need to use Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime dll's reference in .NET managed CSOM application development. But can someone help me understand why we have to use Microsoft.SharePoint.Client.Runtime and whats it's purpose, in detail. or point me to a reference please. Thank you in advance

External images are not displaying in RDLC report

$
0
0
I need to add an external image in my RDLC report. My issue is the image has to come from an external site URL. I passed the URL using report parameter, but doesn't show any output. However, if I pass the URL directly in the RDLC report in the image control it displays the image. Since this doesn't make the report dynamic, I need to know how to make Image display in RDLC report using report parameter.

how to put Form tag inside PlaceHolderUtilityContent

$
0
0

I created a page layout (using design manager), and my design has <form> tags in it

<form><!-- code --></form>


and Ive read that HTML file cannot contain <form> tags here -http://msdn.microsoft.com/en-us/library/office/jj822362(v=office.15).aspx

It says that I should put the form inside the PlaceholderUtitlityContent placeholder

<!--CS: Start Create Snippets From Custom ASP.NET Markup Snippet--><!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderUtilityContent" runat="server">--><!--SPM:<asp:ContentPlaceHolder id="PlaceHolderUtilityContent" runat="server" />--><!--SPM:</SharePoint:AjaxDelta>--><!--CE: End Create Snippets From Custom ASP.NET Markup Snippet-->

My question is where do i insert my form block in the snippet above?


----------------------- Sharepoint Newbie

Viewing all 25064 articles
Browse latest View live