26
Jun
09

#28 Deltek operator (agent) ID & email via Workflow

If you need to get the agent processing the workflow you can call the UDF GetVisionAuditUsername()

You can then wrap this UDF call in a SP to get something like an Email address from the EM table for email processing to the operator/agent which is something missing from Deltek’s WF options. Sending the person doing the operation (agent) an email has been missing in Deltek WF (you can send their manager an email but not the person doing the work). At least this is what we see in 5.1 and since 6.0 is same/same we probably have the same issue there – though I have not checked there. If anyone sees otherwise please post a comment. Thanks!


** Note: This will require the context provided by Deltek’s WF since the UDF uses ‘context_info’ from master.dbo.sysprocesses **

Create Procedure getAgentEmail()
AS
BEGIN
	Declare @Employee as varchar(20)

	Select @Employee = [dbo].[GetVisionAuditUsername]()

	Select EM.Email
        From EM
        Where EM.Employee = Substring(@Employee,1,3)
            -- substring if needed to get proper key

         -- It would be wise to parm these values in!
         EXEC msdb..sp_send_dbmail
            @profile_name='ProfileName'
           , @recipients= @Email
           , @subject='Test message'
           , @body='This is the body of the test message'

END

SQL 2008 Mail Setup
http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/


0 Responses to “#28 Deltek operator (agent) ID & email via Workflow”



  1. No Comments Yet

Leave a Reply