tag:blogger.com,1999:blog-9049032025342264339.post7431520946551341091..comments2024-03-29T01:06:25.773+03:00Comments on sadomovalex's blog: One problem with updating alert template for Sharepoint listAlexey Sadomovhttp://www.blogger.com/profile/18112105989691733410noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-9049032025342264339.post-91871505650624877252014-12-01T10:28:11.006+03:002014-12-01T10:28:11.006+03:00Paul, creating and adding of new alert templates t...Paul, creating and adding of new alert templates to the lists dynamically for sure possible. E.g. in SP2007 there was popular SPSolutions Alerts Manager which had UI for doing that. They created alert templates in config database (base class of their alerts inherited SPPersistedObject as far as I remember and automatically was serialized and saved to config database).Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-54184966784379551252014-12-01T02:08:01.625+03:002014-12-01T02:08:01.625+03:00Hi Alexey,
I've been looking for a way to avo...Hi Alexey,<br /><br />I've been looking for a way to avoid using the stsadm command or creating a copy of the alerttemplates.xml.<br /><br />According to the API it appears possible to create a custom alert template for a list on the fly, which to me seems far friendlier.<br /><br />Assuming custom XML string which could be passed directly within the script (or managed as an external file Tripwirehttps://www.blogger.com/profile/12664618733681351513noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-85492014564191547322014-11-25T14:23:57.086+03:002014-11-25T14:23:57.086+03:00GetValue method is generic, but in comments these ...GetValue method is generic, but in comments these symbols are trimmed. Here is pseudo code:<br />var at = col.GetValue[SPAlertTemplate]("myalert");Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-22867861922649807012014-11-25T14:21:12.741+03:002014-11-25T14:21:12.741+03:00Paul, once you create copy of alerttemplates.xml, ...Paul, once you create copy of alerttemplates.xml, made changes in it (e.g. created new template inside it or changes existing) and called updatealerttemplates command you may get instance of alert template by name. Try the following code:<br /><br />var col = new SPAlertTemplateCollection(SPWebService.ContentService);<br />var at = col.GetValue("myalert");Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-76061082930906486632014-11-25T06:02:17.472+03:002014-11-25T06:02:17.472+03:00This is just what I was after.
Are you able to pr...This is just what I was after.<br /><br />Are you able to provide the expected value for my custom alert template in the PowerShell examples?<br /><br />For example, if I create a copy of alertteamplates.xml how would I reference it? As a string? Relative path?<br /><br />at = "myalert.xml" # Is this correct?<br />list.AlertTemplate = at;Tripwirehttps://www.blogger.com/profile/12664618733681351513noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-49784145357132648822013-04-06T01:37:00.064+04:002013-04-06T01:37:00.064+04:00you are welcome :) it also added headache for me i...you are welcome :) it also added headache for me in own time, so I shared the details about this "non-intuitive behavior".Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-83255943800948988982013-04-05T20:11:57.822+04:002013-04-05T20:11:57.822+04:00Holy freaking crap. Thank you a million times over...Holy freaking crap. Thank you a million times over for this blog post. I had no idea that you could individually update a user's alert's alert template... and it is exactly what I was looking for to circumvent the pitfalls I've been treading through while attempting to modify the OTB alert templates on a specific list. You rock!haliphaxhttps://www.blogger.com/profile/03713825339734390544noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-58077591303308425992012-10-11T23:35:44.413+04:002012-10-11T23:35:44.413+04:00hi Unknown, I didn't write it yet, but remembe...hi Unknown, I didn't write it yet, but remember about it and will write it at some point. The main idea is that SPAlertTemplate inherits SPPersistedObject class which means that you can persist them in the farm configuration database.Alexey Sadomovhttps://www.blogger.com/profile/18112105989691733410noreply@blogger.comtag:blogger.com,1999:blog-9049032025342264339.post-63510146082017894722012-10-11T21:02:37.339+04:002012-10-11T21:02:37.339+04:00Have you gotten around to writing the blog entry t...Have you gotten around to writing the blog entry to create alert templates in configuration database?<br /><br />I would love to have an alternative method for getting my alert templates into the DB.Unknownhttps://www.blogger.com/profile/00389419343665054475noreply@blogger.com