Friday, February 17, 2012

SharePoint Dialog Framework:Modal Popups With Dynamic Html

1)Make sure that ' this character dont appear in string in dynamic string as following.
tootipText=tootipText+" <a style=color:"+fontColor+" href=javascript:portal_openModalDialog("+EventUrl+"); >"+iEventCount +"."+this.toString()+"</a>";
$(tdEvent).attr("onclick", "CalendarEventsPopup('"+tootipText+"');");
function CalendarEventsPopup(result)

result = result.replace(/[(]/g,"('");
result = result.replace(/[)]/g,"')");

var div= "<div id=htmlDiv>
" + result + "</div>
html: document.getElementById('htmlDiv'),
title: "Events",
allowMaximize: false,
showClose: true,
autoSize: true,
dialogReturnValueCallback: Function.createDelegate(
null, portal_modalDialogClosedCallback)


function portal_modalDialogClosedCallback(result, value)

For details about the calendar customization ,I have uploaded source code @CodePlex

Saturday, February 11, 2012

SharePoint 2010 Social Features: Retrieve Noteboard data with SocialDataService.asmx

Noteboard is social data webpart for posting comments for any user activity.Read more..
To get Comments count on particular url
1)Add the jquery reference to masterpage
2)Invoke CountCommentsOnUrl webmethod of Social Data Webservice

<script type="text/javascript">
$(document).ready(function () {
var strURL = "http://server/Pages/PageWithNoteBoard.aspx?ID=3";
var CountMethod = '/_vti_bin/SocialDataService.asmx?op=CountCommentsOnUrl';

// var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'><soap:Body><CountCommentsOnUrl xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService'><url>+ strURL +</url></CountCommentsOnUrl></soap:Body></soap:Envelope>";

var soapEnv = "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'
<CountCommentsOnUrl xmlns='http://microsoft.com/webservices/SharePointPortalServer/SocialDataService'>
<url>" + strURL + "</url>


url: CountMethod,
type: "POST",
async: true,
dataType: "xml",
data: soapEnv,
complete: proccessTagsAndNotes,
contentType: "text/xml; charset="utf-8""


function proccessTagsAndNotes(data, textStatus) {

var count = 0;
// count = $('CountCommentsOnUrlResponse', data).find('CountCommentsOnUrlResult').text();
count = $(data.responseText).find('CountCommentsOnUrlResult').text();

alert(' count' + count);


This code was working fine in my case but the link that helped me is here

Friday, February 3, 2012

Assign Custom Permission Levels in User Information List

1)To Add permissions in User Information List browse
2)right click on any user name link -->copy shortcut-->to get User Information List id
3)form the URL
_layouts/listedit.aspx?List=guid obtained as above
4)In Permission Settings add the Group having Custom Permission
5)Create the custom permission level as shown in following Image
6)you may need to add the custom permission levels for discussion board or to let the ad authenticated user modify there user info,in user information list
1)by default AD authenticated user don't have permissions to edit all the lists
so break the permissions for this list and create custom permissions for ad-authenticated user and add to User Information List
2)same is the case for discussion boards