Archive for the 'hacks' Category

15
Jul
09

#29 PopUp under Deltek 6.x Smart Client

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 & 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.

Add the Help Icon ? and replace the Help Text (directly via a control-V paste do not click on ellipse to launch editor) with:

<script>javascript:  window.showModalDialog("http://targetpage.aspx",'_parent', "dialogHeight: 200px;");</script>

In your target page (html or aspx) since this is a modal window this will ‘correct’ any postbacks from launching a new window.

<HTML>
                <HEAD>
                                <base target="_self" />
 ...

Put a button with a OnClick event to close this popup. The window.opener=’X';window.open(”,’_parent’,”);window.close(); will avoid the usual warning.

Credit Due on avoiding the window close warning: http://blogs.x2line.com/al/articles/350.aspx

					function CopyToClipboard()
					{
						document.frmVisible.txtJobNumber.focus();
						document.frmVisible.txtJobNumber.select();
						CopiedTxt = document.selection.createRange();
						CopiedTxt.execCommand("Copy");
						alert('Number has been copied. Use Control-V to paste into new project screen.');
						window.opener='X';window.open('','_parent','');window.close();
					}

cf . http://dmgorman.wordpress.com/2008/01/11/02-simple-popup-help-page/

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/

10
Jun
08

#09 Simple Alternate Background Row Color

Overwrite the row background color property with this expression.

=iif(RowNumber(Nothing) Mod 2, “WhiteSmoke”, “White”)

For old timers – this creates the Green Bar shading effect on a SQL Reporting  Services Report when applied to a detail row on a table.

I have not tried it but you can probably use the hex color values like #990000 instead of the key words (ie Maroon)

Credit Due:  Professional SQL Server 2005 Reporting Services by Turley, Bryant …

11
Jan
08

#02 Simple PopUp

On all Deltek info center pages you have – as an admin – the ability to add a help icon and insert text.  If you put in html code in the HELP TEXT property as one line without any line breaks you can introduce a popup window that feeds data from somewhere else. Where I work we use it do provide a job number generator using asp.net and SQL Server. The user selects some defining criteria related to their job off of some dropdowns and a transactional stored procedure grabs and formats the next available number. From this point there is some simple javascript to copy to the clipboard via a button and then to the project name field in the project info center via a simple Control-V command.

Note: Our Job/Project Number generator was installed prior to going to 5.0 - I understand that some of this functionality is available now ‘out of the box’.

Sample code put in help text Deltek info center screen: (one line no breaks)

<html><head></head><body><iframe src="http://intranet/somepage.aspx" width=500px height=500px scrolling=no /></body></html>

javascript:

<script>
function CopyToClipboard()
{
document.frmVisible.txtJobNumber.focus();
document.frmVisible.txtJobNumber.select();
CopiedTxt = document.selection.createRange();
CopiedTxt.execCommand("Copy");
alert('Number has been copied. Use Control-V to paste into new project screen.');
}
</script>  

js Credit Due: http://www.geekpedia.com/prog_ttrls_print.php?id=126

11
Jan
08

#01 Hyperlink Direct

#01 – This is documented somewhere officially but I found it indirectly. If you want to go directly to a particular info center in Deltek via a hyperlink the format is as follows:

http://visionserver/vision/launchApp.aspx?initialPage=<info center name>&databaseDescription=<database instance name>&keyValue=<key for info center record>

For example if you were going to a particular client you would enter ‘Clients’ in the info center name & the client internal ID for that client from the CL table in Deltek.  For Projects the ID would be the WBS1 field from the PR table. 

Note1 I can not open a particular tab on the target page.  

Note2 in general the 2 character table names are the major tables.