Friday 17 July 2015

Error 545 Error occurred in deployment step 'Recycle IIS Application Pool': The local SharePoint server is not available. Check that the server is running and connected to the SharePoint farm.

while deploying sharepoint solution to the sharepoint environment.


Add user to the sqlserver admins group.
Limit the No of characters entry in textarea control.


function LimitTextAreaContent() {
    $(".clstxtSummary").keydown(function (event) {
        if ($(this).val().trim().length > 500) {
            $(this).val($(this).val().trim().substring(0, 500));
        }
    });
    $(".clstxtJustification").keydown(function (event) {
        if ($(this).val().trim().length > 1000) {
            $(this).val($(this).val().trim().substring(0, 1000));
        }
    });
    $(".clstxtSummary").keyup(function (event) {
        if ($(this).val().trim().length > 500) {
            $(this).val($(this).val().trim().substring(0, 500));
        }
    });
    $(".clstxtJustification").keyup(function (event) {
        if ($(this).val().trim().length > 1000) {
            $(this).val($(this).val().trim().substring(0, 1000));
        }
    });
    $(".clstxtSummary").on('paste', function (event) {
        setTimeout(function () {
            var text = event.currentTarget.value;
            if (event.currentTarget.value.length > 500) {
                event.currentTarget.value = text.substring(0, 500);
            }
        }, 0);
    });
    $(".clstxtJustification").on('paste', function (event) {
        setTimeout(function () {
            var text = event.currentTarget.value;
            if (event.currentTarget.value.length > 1000) {
                event.currentTarget.value = text.substring(0, 1000);
            }
        }, 0);
    });
    (function ($) {
        $("textarea[id$='txtDelegateComments'], textarea[id$='txtComments'] , textarea[id$='txtResubComments'], textarea[id$='txtDCCComments'] ").bind("change keyup input", function () {
            if ($(this).val().trim().length > 250) {
                $(this).val($(this).val().trim().substring(0, 250));
            }
        });

    })(jQuery);
}

$(document).ready(function () {
    LimitTextAreaContent();
});
sharepoint logout of page after every 20 mins using script

var idle = 0;
$(document).ready(function () {
    //Call timeOutCheck every 10 minutes.
    var idleInterval = setInterval(timeOutCheck, 600000); // 10 minute

    //set idlaTimer to true on mouse click/keypress/keydown
    $(this).mousedown(function (e) {
        idle = 1;
    });
    $(this).keypress(function (e) {
        idle = 1;
    });          
    $(this).keydown(function (e) {
        idle = 1;
    });
});

function timeOutCheck() {

   
    if (idle == 0) { // 20 minutes
        window.location.assign(_spPageContextInfo.webAbsoluteUrl+"/_layouts/15/signout.aspx")
        //alert("time out");
    }
    else
    {
        //reset the timer
        idle = 0;
    }
}


Monday 6 July 2015

calculated column functions
http://blogs.technet.com/b/collaboration/archive/2008/03/28/functions-for-use-in-a-moss-2007-column-today-me-other.aspx