0

I want to add a new CustomAction button on my custom list in Sharepoint 2010, programmatically. (Bear in mind that I am still a bit new to SharePoint)

I've followed the instructions given on these pages, but still can't figure out how to do this:

http://msdn.microsoft.com/en-us/library/hh500259(v=office.14).aspx http://msdn.microsoft.com/en-us/library/cc768562(v=office.12).aspx

To start with I just wanted to add the "Bing it!" button from the first example to my already existing custom content list. But when I add a new CustomAction element in my project as described in the example, the button only appears on standard custom lists, and not on my custom content list.

What I gathered from the second example is that it wanted me to set the ID of my custom content type to the same as the content type I inherit from. So I tried setting it and the RegistrationId on my CustomAction to 0x01. But this only messed up the layout of my add/edit forms and still did not show the button.

From before I had the ID of the list as 0x01008d248abf95d04c7a86ef829bc968282a, so I tried setting the RegistrationId of the CustomAction to this, but again the button did not appear anywhere.

Adding the CustomAction with SharePoint Designer works fine, but I need to do it programmatically.

I dont really know where to go from here. What am I missing?

0

My issue was that I was setting the ID of the list to an ID with lower-case letters, as it seems unsupported.

Changing the ID (0x01008d248abf95d04c7a86ef829bc968282a) to upper-case (0x01008D248ABF95D04C7A86EF829BC968282A) and then setting the RegistrationId of the CustomAction to this ID worked like a charm.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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