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

Changing master page via REST

$
0
0

Hi all,

is it possible to change the master page via REST and if so how can I do it?

I automatically create subsites based on a custom site template via a SPD-workflow. Unfortunately my site template is based on the teamsite, therefore the custom masterpage of my root site isn't pushed to my subsites.

I saw that the masterpage url was accessible via rest: _api/web/masterurl. Now I would like to change it by making a rest call.

Thanks,
Maarten


Ribbon Customization with Visual Studio 2013

$
0
0

Hello Friends,

I want to customize Ribbon of SharePoint 2013. right now i am using Visual Studio 2013 professional. it does not have item template "Ribbon Custom Action" as in Vs 2012.

Ok, i tried to Add the the XML manually from Empty Element , but it is not showing in the ribbon.

i want to know whether i should use VS 2013 or uninstall VS 2013 and go ahead with VS 2012??

Please Help.

Thanks


Mukesh

SharePoint project does not deploy

$
0
0

I upgraded SP 2010 Solution created using VS 2010 to SP 2013 solution in VS 2012. The Solution has one SharePoint project which references another SharePoint project in the same solution. There are "using statements" in the project which refer to classes in the referred project. When I build individual projects or whole solution everything builds fine. However, when I try to deploy or package a project which references another SharePoint project, I get the namespace error:

The type or namespace name 'XXXXX' does not exist in the namespace 'XXXXXX' (are you missing an assembly reference?)



Nadeem Yousuf

How can we increase resource quota of sandbox solution in sharepoint 2013?

$
0
0

Hi,

i have created a sandbox solution for sharepoint 2013 but the problem is it shows that your resource usage exceeds your quota.so is there any way we can increase the resource usage quota.

my application is on sharepoint online 365.

thanks,

Gaurav

SharePoint 2013 App Page is not coming properly.

$
0
0

I have created a SharePoint hosted app and it got deployed correctly without any error but when i am clicking on app,

Page is not coming properly

it is coming like below.

Any idea.please help..


Mohit Khandelwal


CAML Query with Javascript value

$
0
0

Hey everyone,

I am building an Sharepoint 2013 app (SharePoint-Hosted) and using a CAML Query to get the current Item.

The Current Item ID is 1 and i stored it in AccountID, but i want that variable inserted in the CAML Query so i get the proper information.

var AccountID = 1

camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=ID LookupId="TRUE"/><Value Type="Text">1</Value></Eq></Where></Query></View>');


But instead of putting the '1' value in the CAML Query, i want the variable AccountID in it... but how?

Already tried this, but that didn't work:

camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name=ID LookupId="TRUE"/><Value Type="Text">' + AccountID + '</Value></Eq></Where></Query></View>');

Can someone help me with this?

In forward, many thanks!


OAuth Access Tokens

$
0
0

Is there a way to get a AccessToken to be used is a Sharepoint service by directly sending the username/password. Is there a grant_type other than code, where you do not have to be redirected to the Sharepoint login page?

This is more for a Server to Server type scenerio where the usernamame/password is known. We will be accessing sharepoint for not one but multiple sharepoint accounts for different companies.

The Problem I am trying to overcome is with refresh tokens as they are not refreshed without user intervention.Is there a way to refresh "refresh tokens".

Thanks

Atul

what is a scalable aggregator

$
0
0

So I'm studying for the Developing Microsoft SharePoint Server 2013 Advanced Solutions 70-489 exam, and one of the topics they mention in the synopsis for designing solutions to handle a high traffic site is "create a scalable aggregator"

What is a scalable aggregator?  How does one design a solution in SharePoint to create one?


How can I hide or disable List webpart toolbar on SharePoint 2013 Apps pro-grammatically?

$
0
0

Anyone can share me how to hide my list webpart toolbar on my SharePoint 2013 Apps page.

My currently  issue is on SharePoint 2013 Apps development and I need to know how can disable or hide Toolbar(new item or edit this list) by pro-grammatically. Please refer to my attached screenshots for detail. Please do let me know if you still have some things concern.

Regards,


------------------------------------------------------------ ---Tola---

Modifying Master Pages on Personal Sites ( My Content)

$
0
0

Hi Everyone,

I have branded MySite and Personal site collections using the branding code but I am running into an issue.

We are trying to give a uniform look to all the users when their personal site collections are newly created.

Once the master page are under the personal site collections , how do I change the master pages programmatically ?

I have written code which switches the master page to default master page ,deletes the current custom master page and activates the feature which deploys my custom branding .

I am running into "Access Denied" error in my code when I try to execute the above code for personal  ( My Content)  sites of users.

Any solution or hint will be much appreciated.

Thanks,

Shilpa

Multiple login prompt for SharePoint-hosted app

$
0
0

Hi,

I knew that Tony already asked the question for provider-hosted app here. However, the issue is worst for SharePoint hosted app. Let's take the following scenario:

  • I installed 4 apps to a SharePoint site.
  • For each app, I add the app part to the site's homepage.
  • Since each app has a separate URL (ex. http://app-{appid}.appdomain.com), the login prompt will appear 4 times, one for each app. 

This is not ideal for the end users, especially if this is an Intranet but hosted in Office 365. The best solution I have so far is

  • Add the wildcard app domain URL (ex. http://*.appdomain.com) to the Intranet Sites in IE
  • After that, for each login prompt, enter the username/password and check "Remember my credential". This will save the entered credential for EACH app to the credential manager.
  • Every new app I add later, the user will get login prompt again at least once.

Is there any better solution than this?

Regards,

Phi

Configure Friendly URL navigation in Term Store: Target Page not working

$
0
0

I wanted to use the Managed Navigation in order to manage the site navigation from the Term Store.

I have activated the Managed navigation in Site Navigation Settings and created a new term set.

Then in the term Store Management Tool, I gave a target page for this term.

Problem: in the user's SharePoint site, the term is visible but when I clic, the URL is not tranformed into the real Target Page URL (the friendly URL remains and I got a "404 NOT FOUND" error).

Any idea ?

Thanks


Charles



Custom Field Type behavior differs in Foundation and Enterprise Server

$
0
0

Hi Experts,

i wrote a Custom Field Type (SPFieldText) with no XSL for Rendering in Views and deployed to a Foundation-Platform.

Field Shows up in Edit,New and Display mode. Even in the AllItems-View the Field renders its value. 

Then i deployed same Field to a SharePoint-Server (Enterprise). The value does not Show up in Display-Form and AllItems-View but in Edit or New-Form.

After that surprising Situation i added an xsl-file with some coloring, just to see if the xsl renders the field value.

I deployed to both platforms. On Foundation everythings works fine!

On Enterprise Server still same result (Yes, i did iisreset and i also cleared the asp Cache).

I also added logging to this field and i can see, that on Enterprise-Server the Method GetfieldValue(string value) has null as ist value Parameter.

???

I can the the value in the Database of the Enterprise-Server and in EditForm.

Does anybody run into same issue?

Any Ideas how to solve this?

Thanks and Best Regards, Ronny

Word Automation Service Error code: 65543

$
0
0

Hi,

I'm using Word Automation Service for converting Word to PDF files in SharePoint 2013.

I keep getting the error code 65543 "The file could not be converted; it may be corrupt or otherwise invalid (the conversion process failed). Please try opening the file in Microsoft Word, resaving it, and then resubmitting the file for conversion. If this does not resolve the issue, contact your system administrator."

The SharePoint user that is running the conversion job has Read / Write permissions to the SharePoint site and databases.

I've also checked the log files which tellls me that Word Automation Service is running in a sandbox. The Powershell script for disabling the sandbox in SharePoint 2010 is not working anymore in SharePoint 2013. Script provided below.

$sp = Get-SPServiceApplication | where {$_.TypeName.Equals("Word Automation Services")} $sp.DisableSandbox = $true $sp.Update()

Does anyone know what causes this error? (Please don't answer this question by copying MSDN information on Word Automation Services. I already read it :-))

Thanks in advance!

Regards, Sjoukje Zaal


Regards, Sjoukje

Web: http://sjoukjezaal.com | LinkedIn: http://www.linkedin.com/in/sjoukjezaal | Twitter: @SjoukjeZaal

Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you.


owssvr does not work with WebPart-Views

$
0
0

Hi Experts,

how to reproduce:

  • Add a List WebPart from one of your custom Lists to a Wiki-Page.
  • In the WebPart properties pane change the current view (just add more fields..)
  • Click OK and save the page.
  • You will see some data from your list (You should have some data).
  • Right click to open the source
  • Search for ctx = new ContextInfo(); to find your Webpart.
  • Some lines below you will find ctx.view = "{guid of your view}";
  • Copy this View-Id.
  • Copy the List-Id from ctx.listName ="{guid of your list}"; or grap it from list Settings.
  • Now add a script-editor Webpart to same page and add following code:

<script type="Text/javascript">
  function Export()
  {
    var siteURL=window.location.protocol+'//'+window.location.host;
    window.open(siteURL + "/_vti_bin/owssvr.dll?CS=65001&Using=_layouts/query.iqy&List={<YourListGuid>}&View={<YourViewGuid>}&RootFolder=/Lists/<NameOfTheList>&CacheControl=1");
return true;
  }
</script>

<table>
  <tr>
    <td>
      <button onClick="javascript:Export()" style="background-color:#3c9947; color: white; font-weight: bold;font-size: 13px">Export</button>
    </td>
  <tr>
</table>

  • Click Insert and save the page.
  • The page Shows your data and a button.
  • Click the button, so that we can Export the view-Data to Excel.
  • Excel will open. Click 'Activate' if you get a security message. Type your Login if you will requested.
  • Boom, you'll get an unspecific error and Excel-Sheet is blank!

  • Now get the View-Guid from the Default View 'All Items' of your list.
  • Change the script from Script-Editor-WebPart and Change the View-ID to your Default View-ID (Guid)
  • Save your changes.
  • Click the Export-Button again. 
  • Excel will open. Click 'Activate' if you get a security message. Type your Login if you will requested.
  • Excel will load the data. Call to owssvr from Script works!

 So i assume this is By-Design? - Can just use Views which are defined in Lists and not specific Web-Part-Views?

Some Clarifications from Microsoft?

With Kind Regards,

Ronny

 


RSS Viewer in Sharepoint 2013.

$
0
0

Hi,

How to get Rss Feeds in SharePoint 2013 site from a external blog. I don't see RSSViewer webpart in sharepoint 2013.

Thanks,

M.M

Get Everyone Social Feeds

$
0
0

Hello All,

I tried to retrieve Everyone's social feed using javascript object model but it is only getting feeds from the current logged in user not the whole organization.

please find my code below:-

<table width="100%" id="tblPosts"></table><br /><br /><span id="spanMessage" style="color: #FF0000;"></span><SharePoint:ScriptLink ID="ScriptLink1" Name="SP.js" runat="server" OnDemand="false" Localizable="false" LoadAfterUI="true" /><SharePoint:ScriptLink ID="ScriptLink2" Name="SP.UserProfiles.js" runat="server" OnDemand="false" Localizable="false" LoadAfterUI="true" /><SharePoint:FormDigest ID="FormDigest" runat="server" /><script type="text/javascript">

    /*
 * JavaScript Pretty Date
 * Copyright (c) 2011 John Resig (ejohn.org)
 * Licensed under the MIT and GPL licenses.
 */

    // Takes an ISO time and returns a string representing how
    // long ago the date represents.
    function prettyDate(time) {
        //2008-01-26T22:24:17Z
        var timeString = time.getFullYear() + "-" + (time.getMonth() + 1) + "-" + time.getDate() + "T" + time.getHours() + ":" + time.getMinutes() + ":" + time.getSeconds() + "Z";
        var date = new Date((timeString || "").replace(/-/g, "/").replace(/[TZ]/g, " ")),
            diff = (((new Date()).getTime() - date.getTime()) / 1000),
            day_diff = Math.round(diff / 86400);

        if (isNaN(day_diff) || day_diff < 0 || day_diff >= 31)
            return;
        if (day_diff > 6) {
            var format = "dd MMM, yyyy";
            return time.format(format);
        }
        return day_diff == 0 && (
                diff < 60 && "just now" ||
                diff < 120 && "1 minute ago" ||
                diff < 3600 && Math.round(diff / 60) + " minutes ago" ||
                diff < 7200 && "1 hour ago" ||
                diff < 86400 && Math.round(diff / 3600) + " hours ago") ||
            day_diff == 1 && "Yesterday" ||
            day_diff < 7 && day_diff + " days ago";
    }

    // If jQuery is included in the page, adds a jQuery plugin to handle it as well
    if (typeof jQuery != "undefined")
        jQuery.fn.prettyDate = function () {
            return this.each(function () {
                var date = prettyDate(this.title);
                if (date)
                    jQuery(this).text(date);
            });
        };

    // Replace the placeholder value with the account name of the target user.

    // Ensure that the SP.UserProfiles.js file is loaded before the custom code runs.
    SP.SOD.executeOrDelayUntilScriptLoaded(StartFunction, 'SP.UserProfiles.js');

    // Declare global variables.
    var clientContext;
    var feedManager;
    var everyoneFeed;
    function StartFunction() {
        GetFeeds();
        setInterval(GetFeeds, 30000);
    }
    function GetFeeds() {
        
        // Initialize the current client context and the SocialFeedManager instance.
        clientContext = SP.ClientContext.get_current();
        feedManager = new SP.Social.SocialFeedManager(clientContext);

        // Set parameters for the feed content that you want to retrieve.
        var feedOptions = new SP.Social.SocialFeedOptions();
        feedOptions.set_maxThreadCount(5);

        // Get all feed types for current user and get the Personal feed
        // for the target user.
        everyoneFeed = feedManager.getFeed(SP.Social.SocialFeedType.everyoneFeed, feedOptions);
        // Change the sort order to optimize the Timeline feed results.
        feedOptions.set_sortOrder(SP.Social.SocialFeedSortOrder.byCreatedTime);

        clientContext.load(feedManager);
        clientContext.executeQueryAsync(CallIterateFunctionForFeeds, RequestFailed);

    }
    function CallIterateFunctionForFeeds() {
        IterateThroughFeed(everyoneFeed, "Everyone", true);
    }
    function IterateThroughFeed(feed, feedType, isCurrentUser) {
        var tblPosts = document.getElementById('tblPosts');
        tblPosts.insertRow().insertCell();
        var feedHeaderRow = tblPosts.insertRow();

        // Iterate through the array of threads in the feed.
        var threads = feed.get_threads();
        for (var i = 0; i < threads.length ; i++) {
            var thread = threads[i];
            var actors = thread.get_actors();

            if (i == 0) {
                feedHeaderRow.insertCell().innerText = feedType.toUpperCase();
            }

            // Use only Normal-type threads and ignore reference-type threads. (SocialThreadType.Normal = 0)
            if (thread.get_threadType() == 0) {

                // Get the root post's author, content, and number of replies.
                var post = thread.get_rootPost();
                var authorName = actors[post.get_authorIndex()].get_name();
                var postContent = post.get_text();
                var totalReplies = thread.get_totalReplyCount();
                var postDate = prettyDate(post.get_createdTime());

                var author = actors[post.get_authorIndex()];
                var authorLoginName = author.get_accountName();
                var authorImage = author.get_imageUri();
                var authorSite = author.get_uri();

                var postRow = tblPosts.insertRow();
                postRow.insertCell().innerHTML = "<img src='" + authorImage + "'/>";
                postRow.insertCell().innerHTML = "<a href='" + authorSite + "'>" + authorName + "</a>";
                postRow.insertCell().innerText = postDate;
                postRow.insertCell().innerText = authorName + ' posted \"' + postContent+ '\" (' + totalReplies + ' replies)';


                // If there are any replies, iterate through the array and
                // get the author and content. 
                // If a thread contains more than two replies, the server
                // returns a thread digest that contains only the two most
                // recent replies. To get all replies, call the 
                // SocialFeedManager.getFullThread method.
                if (totalReplies > 0) {
                    var replies = thread.get_replies();

                    for (var j = 0; j < replies.length; j++) {
                        var replyRow = tblPosts.insertRow();

                        var reply = replies[j];
                        replyRow.insertCell().innerText = '  - ' + actors[reply.get_authorIndex()].get_name()+ ' replied \"' + reply.get_text() + '\"';
                    }
                }
            }
        }
    }
    function RequestFailed(sender, args) {
        $get("spanMessage").innerText = 'Request failed: ' + args.get_message();
    }</script>


Can't edit page properties on newly created pages

$
0
0

This is very strange. I have moved a couple of SP2010 sites on to our new Sp1013 server. The only change we needed to do was deploy the WSP in compatibility mode (to both the 14 & 15 hive) using

Install-SPSolution -GACDeployment -CompatibilityLevel {14,15} -Identity MySolutionName.wsp

The site has been live to the public for months now. Today a user discovered they couldn't get to the edit properties screen of a newly created page. I have had a look and tested and found that I can edit the properties on all of the old existing pages, but if I create a new page I get an error when I click 'edit properties' or 'view properties' buttons. Looking in the logs for the correlation ID I see this:

Application error when access /education/Pages/Forms/DispForm.aspx, Error=Item does not exist. It may have been deleted by another user.   at Microsoft.SharePoint.SPList.GetItemById(String strId, Int32 id, String strRootFolder, Boolean cacheRowsetAndId, String strViewFields, Boolean bDatesInUtc, Boolean bExpandQuery)     at Microsoft.SharePoint.SPList.GetItemById(String strId, Int32 id, String strRootFolder, Boolean cacheRowsetAndId, String strViewFields, Boolean bDatesInUtc)     at Microsoft.SharePoint.Publishing.CachedListItem.FetchAllFields()     at Microsoft.SharePoint.Publishing.CachedListItem.GetFieldContents(String index, Boolean refetchIfFieldNotFound)     at Microsoft.SharePoint.Publishing.WebControls.SummaryLinkFieldControl.CreateChildControls()

Which looks like it can't load the DispForm.aspx. When trying edit properties I get a similar error for opening EditForm.aspx.

The forms exist. I can see them with SharePoint designer and I can view properties and edit properties of pages that were created previously. I just can't do it with newly created pages.

Does anyone know what is going on here?

how to change sharepoint 2013 home page via powershell

$
0
0

I want to use a custom page to instead of sharepoint 2013 home page via powershell.

anybody know it?


Awen

how to add link to apps of central administration in sharepoint 2013

$
0
0
I want to add custom link to apps of central administration in sharepoint 2013, I checkecd this link, but not found apps gourpid. 

Awen

Viewing all 7589 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>