sharepoint 2010 tagged posts

SharePoint 2010: OrderBy CAML query in SPSiteDataQuery for Taxonomy Fields

Category: #SharePoint Comments: No comments

It’s a while I’m not writing anything in this blog; a lot of stuff to do and a lot of projects went in production.

Today I found a real strange issue and it took me sometime to debug it.
SPSiteDataQuery is a useful object that allows you to search recursively in a web all the items you want.

The properties of this object are the classic ones of the SPQuery.
In my case I wanted to filter for Taxonomy field and sort my items based on the same items.
Till here no problem at all…

I had a site collection with this web part already deployed and working fine; in a new site collection, the same web part didn’t work. After a lot of unit tests I have discovered that if your Taxonomy field is multivalue your Query will return always 0 records...

Read More

ECMA SharePoint 2010 – Checkout and Checkin with JavaScript

Category: #SharePoint Comments: No comments

With ECMA in SharePoint 2010 you can do things that normally – if you want to achieve programmatically – the costs time and money for the client.
One example is to set the CHECKOUT and CHECKIN status of a page. Few lines of JavaScript code and you’re done…

function checkOut(){
        var ctx = SP.ClientContext.get_current();
        var page = ctx.get_web().getFileByServerRelativeUrl(window.location.pathname);
        ctx.executeQueryAsync(Function.createDelegate(this, checkOut_Success),
                                            Function.createDelegate(this, checkOut_Fail));
function checkOut_Success(sender, args){
        alert(‘i am good’);
function checkOut_Fail(sender, args){
        alert(‘something wrong happened…’);


Read More

SharePoint 2010 – Modal Dialog and strange behavior with the dialog.master

Category: #SharePoint Comments: No comments

In SharePoint 2010 is available the object SP.UI.ModalDialog.You’ll have so the modal dialog windows of SharePoint 2010 available for your application page. That’s cool.

To open the modal dialog you execute the JavaScript code below (you can even add some callback event)

function OpenDialog(strPageURL, delegate, w, h) {
var dialogOptions = SP.UI.$create_DialogOptions();
dialogOptions.url = strPageURL; // URL of the Page
dialogOptions.width = w; // Width of the Dialog
dialogOptions.height = h; // Height of the Dialog
dialogOptions.dialogReturnValueCallback = Function.createDelegate(null, delegate); // Function to capture dialog closed event
SP.UI.ModalDialog.showModalDialog(dialogOptions); // Open the Dialog
return false;

To do that you have available the Dialog.master master page...

Read More