SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ive done some dev work with sharepoint last year but nothing like what im building today so Im not very experienced with it. I am trying to add a custom button to the ribbon in a list modeled on the contacts template. I wrote the code for the button and tested it in a custom list. For some reason it isnt showing up in the Contacts list i need it to. everything works just fine in a custom list. Heres my code;


    Title="Export to CSV">

            <CommandUIDefinition Location="Ribbon.ListItem.New.Controls._children">
                                Alt="Export selected items to CSV"
                                LabelText="Export to CSV"
            function resultCallback(result, value)

            var ctx = SP.ClientContext.get_current();
            var items = SP.ListOperation.Selection.getSelectedItems(ctx);
            var myItems = '';
            var i;

            for (i in items)
            myItems += '|' + items[i].id;

            if(myItems != '')
            var options = {
            url: '{SiteUrl}/_layouts/MyPage.aspx?Items=' + myItems + '&amp;ListId={SelectedListId}&amp;Source={Source}',
            title: 'My Page',
            allowMaximize: false,
            showClose: true,
            width: 600,
            height: 600,
            dialogReturnValueCallback: resultCallback };

            }" />

share|improve this question
up vote 0 down vote accepted

RegistrationId="100" this is for generic list

you should try

RegistrationId="105" which is for Contacts

you can get the list of registration id over here:

share|improve this answer
Awesome list!!! I actually solved it yesterday but changing RegistrationType="ContentType" and RegistrationId="0x0106" – Brian Morrison II Oct 19 '12 at 8:46
Your answer is more robust. Just to elaborate my solution, I changed the RegistrationType to "ContentType" to look for Content Type lists and "0x0106" is the RegistrationId for any Contacts based content type list. I found the ID by going to the site collection root>Site Settings>Site Content Types>Contacts and in the URL, the RegistrationId was in the string next to ctype=0x0106. Just another way of doing it I suppose. Im new to Sharepoint dev so I dont know which way is preferred. – Brian Morrison II Oct 19 '12 at 8:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.