3

I've created a feature with a content type:

<ContentType ID="0x01007C963A8770A24bbfBDBCE157B96EE769"
             Name="Send" Group="Demo" Version="1">
</ContentType>

I want to create custom actions for this content type.
This works on the ECB (the popup menu of every item's title):

<CustomAction
    Id="Demo.Send.PopupMenu"
    Title="Send"
    Location="EditControlBlock"
    Description="Hold"
    RegistrationType="ContentType"
    RegistrationId="0x01007C963A8770A24bbfBDBCE157B96EE769">
      <UrlAction Url="http://www.google.com/search?q={ItemId} Cookies"/>
</CustomAction>

However, I can't get it to work on forms' toolbars (edit or display):

<CustomAction
    Id="Demo.Send.DisplayFormToolbar"
    Title="Send"
    Location="DisplayFormToolbar"
    Description="Send"
    RegistrationType="ContentType"
    RegistrationId="0x01007C963A8770A24bbfBDBCE157B96EE769"
    Sequence="108">
       <UrlAction Url="http://www.google.com/search?q={ItemId} Cookies"/>
</CustomAction>

I don't get any error message, I just can't see the button.
It is working if I change the RegistrationId to 0x01, but then I see it on all content types (all items, really).

Any idea what's wrong with this code?

Kobi
  • 135,331
  • 41
  • 252
  • 292

1 Answers1

5

I seem to remember there being issues with content types when they didn't have all capitals in the identifier, both for the definition and when using.

Try

RegistrationId="0x01007C963A8770A24BBFBDBCE157B96EE769"

But completely remove the everything that refers to the content type. (or try a new one)

djeeg
  • 6,685
  • 3
  • 25
  • 28
  • Thanks! It worked, and I didn't even have to create a new one: capitalizing all `RegistrationId`s and the definition worked. I used Visual Stuido's *Create GUID*, which puts lower case letters in the middle just to mess with me. Lesson learned. Thanks a lot! – Kobi Jan 23 '11 at 06:43
  • 2
    Lol, SharePoint is laughable. Some of the development hurdles you need to climb are outright rediculous. This is probably why the consultants get paid so much! – Pierreten Jan 23 '11 at 06:47
  • 1
    I use a shortcut key (macro) to generate Guid in Visual Studio, by including toupper as explained here http://mundeep.wordpress.com/2008/03/27/quickly-generating-guids-in-visual-studio-2008/ it will always be in uppercase – Colin Jan 23 '11 at 18:40