views:

1220

answers:

2

How can I hide a field in a SharePoint alert?

I have a custom event list (Calendar). I have a field (of type Note - aka Multi-line text) whose XML contents I generate manually in an event receiver. All my calendar views use this field as the Title for the Month, Week, and Day views.

I have a web part I include on the page that runs a jquery script that converts the XML title into a background color and mouseover text.

The problem is that this field and its ugly xml show up in sharepoint alerts. If I set the field to Hidden=true then it does not show up in the email, but it is no longer available to select as the Title for the Month, Week, and Day views when creating a new View. This is not acceptable as users need to be able to create views and be able to select this field as the title.

Is there another way to prevent this field from showing up in emails, along the lines of ShowInDisplayForm, ShowInEditForm, etc?

+1  A: 

Can you set another field to have that XML and have the jquery script run against that field instead? That would leave the Title field to be used normally.

The title field is the only one that shows up on the calendar view so I have to stick my XML there.
Chloraphil
Can you access the object model or the web services through your jquery script?Also, why can you not set another field to be the title field for your views? Set xmlTitle as the Title field and have it set your XML, and have Title be the regular Title field which will be emailed out by the alerts.
I could call the webservices from script but that would be slower and there would potentially be a noticeable delay before the formatting was applied.The "Title" I referred to in my question is not the Title of the event, it's one of three drop-downs in the create/modify calendar view page(Month, Week, Day). If I were to create a xmlTitle column it would get emailed out like all the other columns.
Chloraphil
In those dropdowns, you can select any column of the content type. For instance, I could select All Day Event, Attachments, Content Type, etc. If you add a column called xmlTitle and use that as the selection for the dropdowns, you could fill that with your XML and leave your regular Title field alone.
I'm already using a non-title field for my XML. It's the one that gets emailed out when I don't want it to.
Chloraphil
+3  A: 

Would editing the fields in the alert template fix your issue?

http://blogs.msdn.com/sharepointdeveloperdocs/archive/2007/12/07/customizing-alert-notifications-and-alert-templates-in-windows-sharepoint-services-3-0.aspx

"To exclude some fields from being rendered in the email, you should include them in the <DigestNotificationExcludedFields> and <ImmediateNotificationExcludedFields> section."