I had a request to be able to notify a group when a folder has been created and include the folder card data in the notification.
Is this possible?
I had a request to be able to notify a group when a folder has been created and include the folder card data in the notification.
Is this possible?
I can't think of a way to send a notification when a folder is added using a template?
While templates can be used to create folders and populate the folder data card, there is no way to send a notification within the context of a template.
The Notify Me when feature only apply to files. Files move in a workflow, folders do not.
Use the Folder Notification dialog box to add or edit automatic notifications for all files in a folder.
In Dispatch, the Add condition only applies to files, so, you couldn't use that.
Use the Add condition dialog box to specify the paths of files that trigger the Dispatch action when they are added to the vault.
Technically, Dispatch can do it, but you'd have to create the folder via the dispatch script and that would also involve getting all the card attributes and writing them to the datacard. It would be a Frankenstein script :-).
The best 'clean' method would be an add-in where you would have an add-in listening on the "edmcmd_postaddfolder" command.
Cheers,
Joy
.
You can trigger very detailed notifications from SQL Server Agent using a Job, but you're going to need to know a fair amount of SQL to get it to work. Here's an example that might help get you on the right track. It first checks the last time the job successfully ran, then finds all folders created after that time and looks for an 'Owner' on the folder datacard and emails that person. The while loop is there to aggregate all the new folders together so users don't get one email per new folder.
Declare @LastRun datetime Declare @email varchar(255) Set @LastRun = (select top 1 DATEADD(minute,DATEDIFF(minute,GETDATE(),GETUTCDATE()),msdb.dbo.agent_datetime(run_date, run_time)) as [RunDateTime] from msdb.dbo.sysjobs sj JOIN msdb.dbo.sysjobhistory sh ON sj.job_id = sh.job_id where sh.run_status = 1 and sj.name = 'Fill in Name of SQL Job Here' order by RunDateTime desc) Select u.email, p.path as msg into #Results from HistoryProject hp inner join Projects p on hp.ProjectID = p.ProjectID inner join VariableValue vv on vv.ProjectID = p.ProjectID inner join variable v on v.VariableID = vv.VariableID and v.VariableName = 'Owner' inner join users u on u.Username = vv.ValueCache where hp.Time > @LastRun DECLARE recipient_cursor CURSOR FOR (select distinct email from #Results) Open recipient_cursor fetch next from recipient_cursor into @email WHILE @@FETCH_STATUS = 0 BEGIN DECLARE @tableHTML NVARCHAR(MAX) ; SET @tableHTML = N'<H1>New Project Folders</H1>' + N'<table border="1">' + N'<tr><th>Name</th></tr>' + CAST ( ( SELECT td = msg FROM #Results WHERE email = @email FOR XML PATH('tr'), TYPE ) AS NVARCHAR(MAX) ) + N'</table>' ; EXEC msdb.dbo.sp_send_dbmail @recipients=@email, @subject = 'Work Order List', @body = @tableHTML, @body_format = 'HTML' ; FETCH NEXT FROM recipient_cursor INTO @email END CLOSE recipient_cursor DEALLOCATE recipient_cursor
I think that the question needs to be considered in a complex, but not in parts.
For creation of the new project in my opinion the best option is a template.
As to configure it there is a set of examples.
At the same time, the project as a rule has some documents which can be managed through Workflow (for example - Workflow - Project Doc-s).
It is possible to include the document in a template of the New Project - for example Initiation at which Check In (automatically or manually) through Workflow notifications will be sent.
There are no problems with folder structure, moreover, in a template it is possible to configure also the rights of users / groups (including creation of folders, etc.) and variables, etc.
In my opinion, for the specified purpose it is the best option.
Why it is necessary to invent the bicycle?
Or I did not understand something?
Hi,
If PDM Pro - use a template.
Also you can try Dispatch and autotransition of Workflow.
Still you can look in API.