<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Integration Points &#187; Deltek</title>
	<atom:link href="http://dmgorman.wordpress.com/category/deltek/feed/" rel="self" type="application/rss+xml" />
	<link>http://dmgorman.wordpress.com</link>
	<description>Extending Corporate Data ...</description>
	<lastBuildDate>Mon, 01 Mar 2010 03:47:29 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dmgorman.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/09ff9c9336e6ecd7cc49045a62d1aab3?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Integration Points &#187; Deltek</title>
		<link>http://dmgorman.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dmgorman.wordpress.com/osd.xml" title="Integration Points" />
	<atom:link rel='hub' href='http://dmgorman.wordpress.com/?pushpress=hub'/>
		<item>
		<title>#37 Simple Client calling a WS method in Deltek&#8217;s Open API</title>
		<link>http://dmgorman.wordpress.com/2010/02/04/37-simple-ws-client-consuming-delteks-open-api/</link>
		<comments>http://dmgorman.wordpress.com/2010/02/04/37-simple-ws-client-consuming-delteks-open-api/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 17:33:12 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=410</guid>
		<description><![CDATA[This is a simple method call to the Xtend61 API.  I am using Visual Studio 2008 &#38; a simple legacy web service connection (Web Reference). To test I used a simple web form that has a button to invoke the call and some linq code to parse the response xml. I used the GetEmployeesByKey()  method [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=410&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>This is a simple method call to the Xtend61 API.  I am using Visual Studio 2008 &amp; a simple legacy web service connection (Web Reference). To test I used a simple web form that has a button to invoke the call and some linq code to parse the response xml. I used the GetEmployeesByKey()  method to get name and phone number.</p>
<p>You have to add a web reference (right-click &amp; add Web Reference) to the web service. The target url is http://&lt;webserver&gt;/vision/VisionWS.asmx.  You will have to authenticate to the target server. VS does a lot of work for you creating a proxy class which you&#8217;ll see under App_WebReferences. It also puts a small key reference in you web.config &lt;appSettings&gt;. That change and the proxy class will need to be copied to your production setup along with the new page.</p>
<pre class="brush: csharp;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Net;
using System.Xml.Linq;

public partial class Vision6Test : System.Web.UI.Page
{

 protected void Page_Load(object sender, EventArgs e)
 {

 System.Security.Principal.WindowsIdentity user = System.Security.Principal.WindowsIdentity.GetCurrent();  //operator

 if (IsPostBack)
 PagePostback();
 else
 PageInitialPost();

 }

 private void PageInitialPost()
 {
  Page.SetFocus(txtEmpNum);
 }

 private void PagePostback()
 {

 }

 protected void btnSubmit_Click(object sender, EventArgs e)
 {
 if (Utilities.hasNoData(txtEmpNum))             // check for no data inbound
 {
 lblMessage.Text = &quot;Missing Employee Number&quot;;
 return;
 }

 string UserID = &quot;someUser&quot;;
 string Password = &quot;pwd&quot;;
 string Domain = &quot;YourDomain&quot;;
 string DatabaseDescription = &quot;Vision6&quot;;         // from Web link - see doc
 string IntegratedSecurity = &quot;Y&quot;;                    // match ID setting in system

 vision6.DeltekVisionOpenAPIWebService proxy = new bwvision6.DeltekVisionOpenAPIWebService();        //Web Reference Proxy

 // Setup Parms
 string ConnInfoXml = @&quot;&lt;VisionConnInfo&gt;&lt;databaseDescription&gt;&quot; + DatabaseDescription + @&quot;&lt;/databaseDescription&gt;&quot;;
 ConnInfoXml += @&quot;&lt;userName&gt;&quot; + UserID + @&quot;&lt;/userName&gt;&quot;;
 ConnInfoXml += @&quot;&lt;userPassword&gt;&quot; + Password + @&quot;&lt;/userPassword&gt;&quot;;
 ConnInfoXml += @&quot; &lt;integratedSecurity&gt;&quot; + IntegratedSecurity + @&quot;&lt;/integratedSecurity&gt;&quot;;
 ConnInfoXml += @&quot;&lt;/VisionConnInfo&gt;&quot;;

 string Keys = txtEmpNum.Text.Trim();              // inbound Employee ID from webpage
 string RecordDetail = &quot;Primary&quot;;                        // send only primary record back

 // pass credentials on call - should use some dedicated account
 proxy.UseDefaultCredentials = true;
 proxy.Credentials = new NetworkCredential(UserID, Password, Domain);

 string WSResponse  = proxy.GetEmployeesByKey(ConnInfoXml, Keys, RecordDetail);

 // check empty response
 if (WSResponse == @&quot;&lt;RECS&gt;&lt;/RECS&gt;&quot; || Utilities.hasNoData(WSResponse))
 {
 string sEmp = txtEmpNum.Text.Trim();
 clearAll();
 lblMessage.Text = &quot;Employee &quot;  + sEmp + &quot; Not Found&quot;;
 return;
 }
 string sXML = preProcessXML(WSResponse);
 lblResults.Text = parseXML(sXML, &quot;FirstName&quot;);
 lblResults.Text += &quot; &quot; + parseXML(sXML, &quot;LastName&quot;);
 lblResults.Text += &quot; &quot; + parseXML(sXML, &quot;WorkPhone&quot;);
 lblResults.Text += @&quot; x/&quot; + parseXML(sXML, &quot;WorkPhoneExt&quot;);
 }

 private string parseXML(string xml, string targetField)
 {
 string sReturn = &quot;&quot;;
 XElement ele = XElement.Parse(xml);
 try
 {
 sReturn = ele.Elements().Descendants(targetField).First().Value;
 }
 catch (NullReferenceException nex) // drop nulls default to empty string
 {
 string sDrop = nex.ToString();
 }
 catch (Exception ex)
 {
 string sDrop = ex.ToString();   // you can throw a new exception or handle this
 }
 return (sReturn);
 }

 private string preProcessXML(string sXML)
 {
 sXML = sXML.Replace(&quot;&amp;gt;&quot;, &quot;&gt;&quot;);
 sXML = sXML.Replace(&quot;&amp;lt;&quot;, &quot;&lt;&quot;);
 return (sXML);
 }

 private void clearAll()
 {
 txtEmpNum.Text = &quot;&quot;;
 lblMessage.Text = &quot;&quot;;
 lblResults.Text = &quot;&quot;;
 Page.SetFocus(txtEmpNum);
 }

 protected void btnClear_Click(object sender, EventArgs e)
 {
 clearAll();
 }
}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/410/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/410/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/410/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=410&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2010/02/04/37-simple-ws-client-consuming-delteks-open-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>
	</item>
		<item>
		<title>#35 Project Planning Workflow Webservice Parsing Plan Info</title>
		<link>http://dmgorman.wordpress.com/2010/01/19/35-project-planning-workflow-webservice-parsing-plan-info/</link>
		<comments>http://dmgorman.wordpress.com/2010/01/19/35-project-planning-workflow-webservice-parsing-plan-info/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 16:56:08 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[Linq]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Workflow]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=382</guid>
		<description><![CDATA[Set up a simple web service  and code the following exposed WebMethod and private parsing routine.  On Deltek 6.1 you configure this by setting a reference to the WS (i.e. http://mywebserever/webservice.asmx?WSDL) and selecting the exposed method in the populated dropdown.  On Project Planning just add a custom button and map the WF call.  If you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=382&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Set up a simple web service  and code the following exposed WebMethod and private parsing routine.  On Deltek 6.1 you configure this by setting a reference to the WS (i.e. http://mywebserever/webservice.asmx?WSDL) and selecting the exposed method in the populated dropdown.  On Project Planning just add a custom button and map the WF call.  If you want to do some other processing and do not care about sending anything back send an empty string back to Deltek.</p>
<pre class="brush: csharp;">

using System.Linq;
using System.Web.Services;
using System.Xml.Linq;
using System;

namespace WSJNG
{
 /// &lt;summary&gt;
 /// Summary description for Service1
 /// &lt;/summary&gt;
 [WebService(Namespace = &quot;http://someserver/testWS/&quot;)]
 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
 [System.ComponentModel.ToolboxItem(false)]

public class Service1 : System.Web.Services.WebService
 {

/// &lt;summary&gt;
 ///  This takes in data from Deltek Workflow call which sends a serialized form of planning data and
 ///  sends back the Department Manager (Supervisor) as a Deltek Warning.
 ///  You could call a DB Proc or some other processing instead.
 /// &lt;/summary&gt;
 /// &lt;param name=&quot;sPlanInfo&quot;&gt;&lt;/param&gt;
 /// &lt;returns&gt;&lt;/returns&gt;
 [WebMethod]
 public string processPlanInfoSendWarning(string sPlanInfo)
 {
 string sXML = sPlanInfo.Replace(&quot;&amp;gt;&quot;, &quot;&gt;&quot;);
 sXML = sXML.Replace(&quot;&amp;lt;&quot;, &quot;&lt;&quot;);
 string DeptMgr = parseXML(sXML, &quot;emSupervisor&quot;);
 return (@&quot;&lt;errors warning='y'&gt;&lt;error&gt;Department Manager For This Plan Is: &quot; + DeptMgr + &quot;&lt;/error&gt;&lt;/errors&gt;&quot;);
 }

 private string parseXML(string xml, string targetField)
 {

 string sReturn = &quot;&quot;;

 XElement ele = XElement.Parse(xml);

 try
 {
   sReturn = ele.Elements().Descendants(targetField).First().Value;
 }
 catch (NullReferenceException ex) // drop nulls default to empty string
 {
   string sDrop = ex.ToString();
 }

 return (sReturn);

 }
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/382/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/382/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/382/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=382&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2010/01/19/35-project-planning-workflow-webservice-parsing-plan-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>
	</item>
		<item>
		<title>#34 Pending Deltek Contracts</title>
		<link>http://dmgorman.wordpress.com/2009/12/16/34-pending-deltek-contracts/</link>
		<comments>http://dmgorman.wordpress.com/2009/12/16/34-pending-deltek-contracts/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 15:12:40 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[Intranet Integration]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=370</guid>
		<description><![CDATA[
Here is a Stored Procedure used to load a data grid (we use a Telerik RadGrid) with a list of groups and filtered Pending Contracts.
The proc accepts two parms that if null are ignored: (1) ClientCode could be ClientID but we use a simplier field called ClientCode &#38; (2) ContractStatus which is what is the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=370&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://dmgorman.files.wordpress.com/2009/12/pendingcontracts3.png"><img class="aligncenter size-full wp-image-380" title="PendingContracts" src="http://dmgorman.files.wordpress.com/2009/12/pendingcontracts3.png?w=655&#038;h=272" alt="" width="655" height="272" /></a></p>
<p>Here is a Stored Procedure used to load a data grid (we use a Telerik RadGrid) with a list of groups and filtered Pending Contracts.</p>
<p>The proc accepts two parms that if null are ignored: (1) ClientCode <em>could be ClientID but we use a simplier field called ClientCode</em> &amp; (2) ContractStatus which is what is the status colum dropdown is populated with.</p>
<pre class="brush: sql;">
Procedure [dbo].[BWSP_getPendingContracts]
(
 @ClientCode            varchar(32)
 ,@ContractStatus    varchar(50)
)
as
Select
 CL.Client
 , CL.Name
 , CT.*
 , EM.Email
 , 'MailTo:' + RTRIM(PM.Email)
 + RTRIM('&amp;subject=Pending%20Contract&amp;body=')
 + RTRIM('Client:')  + RTRIM(CL.Client) + '%0A'
 + RTRIM('Project:')  + RTRIM(PR.WBS1) + '%0A'
 + RTRIM('Status:')  + LTRIM(CT.custContract_Status) + '%0A'
 as PMMailTo
 , 'MailTo:' + RTRIM(CM.Email)
 + RTRIM('&amp;subject=Pending%20Contract&amp;body=')
 + RTRIM('Client:')  + RTRIM(CL.Client) + '%0A'
 + RTRIM('Project:')  + RTRIM(PR.WBS1) + '%0A'
 + RTRIM('Status:')  + LTRIM(CT.custContract_Status) + '%0A'
 as CMMailTo
 , ISNULL(RTRIM(EM.PreferredName),RTRIM(EM.FirstName))  + ' '+ RTRIM(EM.LastName) As Requestor
 , ISNULL(RTRIM(PM.PreferredName),RTRIM(PM.FirstName))  + ' '+ RTRIM(PM.LastName) As PMName
 , PM.Email as PMEmail
 , ISNULL(RTRIM(CM.PreferredName),RTRIM(CM.FirstName))  + ' '+ RTRIM(CM.LastName) As CMName
 , CM.Email as CMEmail
from dbo.Projects_ContractTracking CT
 Join PR on (PR.WBS1 = CT.WBS1 and PR.WBS2 = CT.WBS2 and PR.WBS3 = CT.WBS3)
 Join EM on (EM.Employee =  CT.custContract_RequestedBy)
 Join EM CM on (PR.Principal = CM.Employee)
 Join EM PM on (PR.ProjMgr = PM.Employee)
 Join CL on (CL.ClientID = PR.ClientID)
Where CT.WBS2 = ''
 and CT.custContract_Status in ('0-Draft being prepared','1-Pending (draft sent to Client)','2-Pending (final sent to Client)','6-On Hold-See Memo')
 and CL.Client = isNull(@ClientCode,CL.Client)
 and CT.custContract_Status = isNull(@ContractStatus, CT.custContract_Status)
Order By CT.WBS1
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/370/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/370/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/370/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=370&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2009/12/16/34-pending-deltek-contracts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>

		<media:content url="http://dmgorman.files.wordpress.com/2009/12/pendingcontracts3.png" medium="image">
			<media:title type="html">PendingContracts</media:title>
		</media:content>
	</item>
		<item>
		<title>#32 Our Expense Notices</title>
		<link>http://dmgorman.wordpress.com/2009/11/25/32-our-expense-notices/</link>
		<comments>http://dmgorman.wordpress.com/2009/11/25/32-our-expense-notices/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 13:03:05 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=347</guid>
		<description><![CDATA[We send out simple email notices from information in Deltek&#8217;s database.
If you have the Enterprise Edition of SQL Server you can do this straight-up using Data Driven Subscriptions which is a really nice feature of SQL Reporting that allows you to use a query to determine who gets the report via email and what is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=347&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>We send out simple email notices from information in Deltek&#8217;s database.</p>
<p>If you have the Enterprise Edition of SQL Server you can do this straight-up using Data Driven Subscriptions which is a really nice feature of SQL Reporting that allows you to use a query to determine who gets the report via email and what is in the report for each one sent.  Here is a link  to get you started: <a title="Data Driven SQL Reports Subscriptions" href="http://msdn.microsoft.com/en-us/library/ms169673.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms169673.aspx</a><br />
<em><br />
But since we do not have that license and option &#8230;  I am using an asp.net page &amp; coding the two</em><em> </em><em> queries needed for the Data Driven Subscriptons &#8211; (1) to get the target email address &amp; (2) to get the report details (namely their expense report notes) </em><em>as one simple query in a stored procedure</em><em>.  The result is a custom email sent via SMTP to each person posting an expense report.<br />
</em><br />
This is the extraction Stored Procedure:</p>
<pre class="brush: sql;">
Procedure [dbo].[getExpenseReceipts]
as
Select      EM.email
,               EM.Employee
,               EX.EmployeeName
,               EX.Amount
,               EX.CheckNo
,               EX.CheckDate
,               EX.ReportName
,               EX.ReportDate
from EM
Join exChecks EX on ( EM.Employee = EX.Employee )
</pre>
<p>On our intranet we have a grid that displays the pending check receipt data &amp; a simple process button to approve. This page is secure to accounting personnel.</p>
<p>The process uses SMTP and data from the Stored Procedure above to form an individual email for each involved employee.</p>
<pre class="brush: csharp;">
 private void sendNotifications()
    {

        string sTitle = &quot;Expense Check Notification&quot;;
        string sMsg = &quot;&quot;;
        string sSourceEmail = @&quot;***@***&quot;;
        DataSet ds = DeltekUtilities.getPendingExpenseNotifications(); // ADO call to get data using the SP above
        DataTableReader  dr = ds.CreateDataReader();
        int ii = 0;
        while (dr.Read())
        {
            ii++;
            sMsg = &quot;===================================================================================&quot; + &quot;\n&quot;;
            sMsg += &quot;                    Expense Check Notification   &quot; + &quot;\n&quot;;
            sMsg += &quot;===================================================================================&quot; + &quot;\n\n&quot;;
            //sMsg += &quot;               Email: &quot; + dr[&quot;email&quot;].ToString() + &quot;\n&quot;;
            sMsg += &quot;            Employee: &quot; + dr[&quot;EmployeeName&quot;].ToString() + &quot;\n&quot;;
            sMsg += &quot;      Deposit Amount: &quot; + String.Format(&quot;{0:c}&quot;, Double.Parse(dr[&quot;Amount&quot;].ToString())) + &quot;\n&quot;;
            sMsg += &quot;        Deposit Date: &quot; + String.Format(&quot;{0:d}&quot;, dr[&quot;CheckDate&quot;]) + &quot;\n&quot;;
            sMsg += &quot;         Description: &quot; + dr[&quot;ReportName&quot;].ToString() + &quot;\n&quot;;
            sMsg += &quot;---------------------------------------------------------------------------------&quot;;

            try
            {
                Utilities.sendEmail(sSourceEmail, dr[&quot;email&quot;].ToString().Trim(), string.Empty, sTitle, sMsg, false);
            }
            catch (Exception ex)
            {
                lblMessage.Text += &quot;&lt;br&gt; error sending: &quot; +  dr[&quot;email&quot;].ToString();
            }
        }
        if (dr != null)
        {
            dr.Close();
            dr.Dispose();
        }

        lblMessage.Text += &quot;&lt;br&gt;&quot; +  ii.ToString() + &quot; Emails Sent&quot;;

    }

// Send Email Utility Call

public static bool sendEmail(string sSourceEmail, string sTargetEmailList, string sCCEmailList, string sMsgTitle, string sMsg,  bool isHTMLemail)
    {

        bool bReturn    = false;
        SmtpClient client = new SmtpClient();
        client.Host = &quot;****&quot;;
        MailMessage mm = new MailMessage();
        try
        {
            mm.Sender       = new MailAddress(sSourceEmail);
            mm.From         = new MailAddress(sSourceEmail);
            mm.To.Add (new MailAddress(sTargetEmailList));
            if (sCCEmailList.Length &gt; 0)
                mm.CC.Add (new MailAddress(sCCEmailList));
            mm.Subject      = sMsgTitle;
            mm.Body         = sMsg;
            mm.IsBodyHtml   = isHTMLemail;

            client.Send(mm);
            bReturn = true;
        }
        catch (Exception ex)
        {
            string sEmails = &quot; Email List [&quot; + sSourceEmail + &quot; &quot; + sTargetEmailList + &quot; &quot; + sCCEmailList + &quot;] &quot;;
            throw new IntranetException(ex.Message + sEmails,
                                              ex,
                                              SystemConstants.Intranet_ErrorMessage);

        }

        return bReturn;
    }
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/347/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/347/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/347/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=347&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2009/11/25/32-our-expense-notices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>
	</item>
		<item>
		<title>#29 PopUp under Deltek 6.x Smart Client</title>
		<link>http://dmgorman.wordpress.com/2009/07/15/29-popup-under-deltek-6-x-smart-client/</link>
		<comments>http://dmgorman.wordpress.com/2009/07/15/29-popup-under-deltek-6-x-smart-client/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 16:46:08 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=303</guid>
		<description><![CDATA[The issue is that by running a smart client an iframe or window open launches a browser window separate from the smart client which is a Windows client executable &#38; not a browser app. Since that is unavoidable using a modal window with target self tag in the head works best.  This method will [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=303&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>The issue is that by running a smart client an iframe or window open launches a browser window separate from the smart client which is a Windows client executable &amp; not a browser app. Since that is unavoidable using a modal window with target self tag in the head works best.  This method will however still leave the initial help window open in the smart client. </p>
<p>Add the Help Icon ? and replace the Help Text (directly via a control-V paste do not click on ellipse to launch editor) with:</p>
<pre class="brush: jscript;">
&lt;script&gt;javascript:  window.showModalDialog(&quot;http://targetpage.aspx&quot;,'_parent', &quot;dialogHeight: 200px;&quot;);&lt;/script&gt;
</pre>
<p>In your target page (html or aspx) since this is a modal window this will &#8216;correct&#8217; any postbacks from launching a new window. </p>
<pre class="brush: xml;">
&lt;HTML&gt;
                &lt;HEAD&gt;
                                &lt;base target=&quot;_self&quot; /&gt;
 ...
</pre>
<p>Put a button with a OnClick event to close this popup. The <em> window.opener=&#8217;X';window.open(&#8221;,&#8217;_parent&#8217;,&#8221;);window.close();</em>  will avoid the usual warning. </p>
<p>Credit Due on avoiding the window close warning: <a href="http://blogs.x2line.com/al/articles/350.aspx">http://blogs.x2line.com/al/articles/350.aspx<br />
</a></p>
<pre class="brush: jscript;">
					function CopyToClipboard()
					{
						document.frmVisible.txtJobNumber.focus();
						document.frmVisible.txtJobNumber.select();
						CopiedTxt = document.selection.createRange();
						CopiedTxt.execCommand(&quot;Copy&quot;);
						alert('Number has been copied. Use Control-V to paste into new project screen.');
						window.opener='X';window.open('','_parent','');window.close();
					}
</pre>
<p>cf . <a href="http://dmgorman.wordpress.com/2008/01/11/02-simple-popup-help-page/">http://dmgorman.wordpress.com/2008/01/11/02-simple-popup-help-page/ </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/303/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/303/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/303/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=303&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2009/07/15/29-popup-under-deltek-6-x-smart-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>
	</item>
		<item>
		<title>#28 Deltek operator (agent) ID &amp; email via Workflow</title>
		<link>http://dmgorman.wordpress.com/2009/06/26/28-deltek-user-id-via-workflow/</link>
		<comments>http://dmgorman.wordpress.com/2009/06/26/28-deltek-user-id-via-workflow/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 02:39:23 +0000</pubDate>
		<dc:creator>dmgorman</dc:creator>
				<category><![CDATA[Deltek]]></category>
		<category><![CDATA[hacks]]></category>

		<guid isPermaLink="false">http://dmgorman.wordpress.com/?p=276</guid>
		<description><![CDATA[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&#8217;s WF options.  Sending the person doing [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=276&subd=dmgorman&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>If you need to get the agent processing the workflow you can call the UDF <strong>GetVisionAuditUsername()<br />
</strong></p>
<p>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&#8217;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 &#8211; though I have not checked there. If anyone sees otherwise please post a comment. Thanks!</p>
<p><em><br />
** Note: This will require the context provided by Deltek&#8217;s WF since the UDF uses &#8216;context_info&#8217; from master.dbo.sysprocesses **</em></p>
<pre class="brush: sql;">
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
</pre>
<p><strong>SQL 2008 Mail Setup</strong><br />
<a target='_blank' href="http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/">http://blog.sqlauthority.com/2008/08/23/sql-server-2008-configure-database-mail-send-email-from-sql-database/  </a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dmgorman.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dmgorman.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dmgorman.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dmgorman.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dmgorman.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dmgorman.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dmgorman.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dmgorman.wordpress.com/276/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dmgorman.wordpress.com/276/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dmgorman.wordpress.com/276/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dmgorman.wordpress.com&blog=2497805&post=276&subd=dmgorman&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dmgorman.wordpress.com/2009/06/26/28-deltek-user-id-via-workflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0f40e4ba23d8f519bc9491fe6ae71f78?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dmgorman</media:title>
		</media:content>
	</item>
	</channel>
</rss>