How To: Subscribe Roles to a Forum Follow
This script will subscribe specified roles to Conversations. Alter the red text to reflect the appropriate role ID(s) and Conversation ID. This information can be found in the database or from the portal if you are a portal administrator.
To find the Role ID(s):
Go to Portal Tools > Manage Roles > Role Manager > Find the role ID(s) in the 4th column
To find the Conversation ID:
Go to Module Tools > Conversations > Manage Conversations > Click on the Conversation Name > Copy the ID out of the URL bar (shown in red bold in the example below)
ex.) https://yourportalURLhere/Modules/Forums/Properties.aspx?boardId=2ca01a21-f499-4e1b-8b84-b3198b643c97&returnUrl=https%3a%2f%2fyourportalURLhere%2fModules%2fForums%2fBoardList.aspx
Take a backup of the framework database (typically Production_Portal_PortalFx).
Run the script below after changing the information in red.
Insert into PWForumSubscriptions
Select UserID, BoardID, Null from
(Select BoardID, UserID from
(SELECT PWRoles.GuidID, PWUser.UserID
FROM PWRoleMembers INNER JOIN
PWUser ON PWRoleMembers.UserID = PWUser.UserID INNER JOIN PWRoles on PWRoles.ID = PWRoleMembers.RoleID
where PWUser.Activated = 1 and roleid IN ('Role1','Role2') ) as y INNER JOIN BoardMembership on BoardMembership.MemberId = y.GuidID WHERE BoardID='ConversationID') as z
INSERT INTO ResourceSubscriptions
(UserID, IsResourceDeleted, ResourceType, ResourceID, Name, SupportsOnCreate, OnCreate, OnCreateData, SupportsOnDelete, OnDelete, OnDeleteData, SupportsOnChange, OnChange, OnChangeData, LastAlertSentDateTime, NumOfDaysInterval)
SELECT z.UserID
,'0' as IsResourceDeleted
,'Board' as ResourceType
,z.[Id] as ResourceID
,z.[Name]
,'0' as SupportsOnCreate
,'0' as OnCreate
,Null as OnCreateData
,'0' as SupportsOnDelete
,'0' as OnDelete
,Null as OnDeleteData
,'0' as SupportsOnChange
,'0' as OnChange
,Null as OnChangeData
,Null as LastAlertSentDateTime
,'-1' as NumOfDaysInterval
FROM
(Select Name, ID, UserID from
(SELECT PWRoles.GuidID, PWUser.UserID
FROM PWRoleMembers INNER JOIN
PWUser ON PWRoleMembers.UserID = PWUser.UserID INNER JOIN PWRoles on PWRoles.ID = PWRoleMembers.RoleID
where PWUser.Activated = 1 and roleid IN ('Role1','Role2')
) as y CROSS JOIN Board where Board.ID = 'ConversationID'
) as z
Make sure users have their alert preferences set so they will receive a subscription notification when a new forum is added to the conversation.
Comments
0 comments
Please sign in to leave a comment.