Feeds:
Posts
Comments

Archive for the ‘MOSS’ Category


Recently had a requirement to update the title of the document with the same name as of document irrespective of what user sets, thought to do it via javascript but then given 2013 changed my mind to give it a try with ECMA script, it took an hour(most of it in finding the name of the document:( ) of troubleshooting but got it working ūüôā

Could have done it in lesser steps may be only one query load, but left it in a raw state for others to read through and refine as required ūüėČ

in case someone want to go through some extra steps

UpdateListItemTitle


<script type='text/javascript'>

function getContext()

{

    try

    {

        var context = new SP.ClientContext.get_current(); 

        var list = context.get_web().get_lists().getByTitle('Documents');; 

        var camlQuery = new SP.CamlQuery();

        camlQuery.set_viewXml('');

        this.collListItem = list.getItems(camlQuery);

        context.load(collListItem);

        context.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));        

    }

    catch(exception)

    {

        alert(exception);

    }

}

function onQuerySucceeded(sender, args) {

    try

    {

        var listItemInfo = '';

        var listItemEnumerator = collListItem.getEnumerator();

        while (listItemEnumerator.moveNext()) {

            var oListItem = listItemEnumerator.get_current();

            alert("Updating item with ID-->"+oListItem.get_item('ID')+" with Title-->"+oListItem.get_item('Title')+" To new Title -->"+oListItem.get_item('FileLeafRef'));

            //if(oListItem.get_item('Title')==null){}

            updateListItem(oListItem.get_item('ID'), oListItem.get_item('FileLeafRef'));

        }

    }

    catch(ex)

    {alert(ex);}

}

function onQueryFailed(sender, args) {

    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());

}

function updateListItem(ItemID, title) {

    var clientContext = new SP.ClientContext.get_current();

    var oList = clientContext.get_web().get_lists().getByTitle('Documents');

    this.oListItem = oList.getItemById(ItemID);

    oListItem.set_item('Title', title);

    oListItem.update();

    clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededUpdate), Function.createDelegate(this, this.onQueryFailedUpdate));

}

function onQuerySucceededUpdate() {

    alert('Item updated!');

}

function onQueryFailedUpdate(sender, args) {

    alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());

}

_spBodyOnLoadFunctionNames.push("getContext");

</script>

Read Full Post »


received¬†a question recently thought would share with all :), Especially for those who haven’t planned upgradation to¬†Project Server¬†2010, be aware that MS Project Server & MS Portfolio Server¬†main stream support end date is 4 /10/2010, though extended support end date is¬†far enough,¬†hence Plan your upgrade¬†accordingly ūüôā

For other MS product life cycle refer to : http://support.microsoft.com/lifecycle/search/default.aspx?sort=PN&alpha=project&Filter=FilterNO

Read Full Post »


While trying to save / open¬†an office 2010 excel workbook¬†to / in¬†sharepoint site, you get an error “Unexpected Error” or “File cannot be saved to this location” , this error is specific to MS office 2010, in office 2010,¬† “Protected View”¬†is a new security feature in Microsoft Office 2010. It removes support for legacy document formats and causes files deemed unsafe to be opened in read-only mode.¬†When installing Office 2010 on the same machine as SharePoint¬†Server 2010, you must disable the protected view to save files to the SharePoint¬†Server and view the Office 2010 documents from the SharePoint¬†2010. Please remember that if you want to enable the readonly¬†view of the Office documents like Word, Excel, PowerPoint, or¬† OneNote¬†on the SharePoint, you may enable similar feature using the Office Web Applications without disabling the protected view

How to Disable Protected View :: Follow the steps

Open Office Application Excel 2010 >> File >> Options >> Trust Centre >> Trust Centre Settings >> Protected View >> uncheck all 3 check boxes under protected view section

Read Full Post »


 

While working with Infopath Forms, i was suppose to move infopath forms from one library to another and then re-link them,
while moving was pretty easy using the library explorer view, re-linking was a pain going through manually marking check box for
each and every form and then re-linking those forms, but there is a solution you might find useful, Follow the steps and you will be relieved of the pain ūüôā

  • GOTO Form Library >> Form Library Settings >> Under Permission and Management >> Relink Documents to this library >>
  • Copy the URL >> Opent this Repair.aspx page in sharepoint designer
  • Change the page view to Split so that code part is visible >> View >> Page >> Split
  • Locate the <FORM> Tag, scroll bottom, usually will find around line 204
  • Just beneath the </FORM> form closing tag paste the code given below, remember to change the double quotes as due to different webpage font it may not be recognized and will result in error,
  • Save the page and refresh the page in browser and scroll to the bottom of the page, you will get a ‚ÄúCheck All ‚Äú button at the bottom
  • click on that and Viola, your all check boxes are marked ‚Ķ‚Ķ. ūüôā

 

<FORM id="SubmitRepairDocsForm" method="POST" action="">
        <INPUT id="SubmitRepairRedirectList" type="hidden" name="SubmitRepairRedirectList" />
        <INPUT id="SubmitRepairRedirectFolder" type="hidden" name="SubmitRepairRedirectFolder" />
        <INPUT id="SubmitRepairDocs" type="hidden" name="SubmitRepairDocs" />
        <SharePoint:FormDigest runat=server ForceRender="true"/>
    <script type="text/javascript" language="javascript">
        function CheckAll(chk)
        {
            for (i = 0; i < chk.length; i++)
            chk[i].checked = true ;
        }
    </script>
    <input type="button" value="Check All" onclick="CheckAll(document.forms.aspnetForm.chkRepair)" >
</FORM>

 

image

image

Read Full Post »


Read Full Post »

Older Posts »