Archive for June, 2009

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/

03
Jun
09

#27 Simple Ajax WebPart Setup

This post is liberally linked into other very good resources – I only offer it as a help or path through some of the options. The ‘lazy’ web.config reconfigure via Visual Studio framework switch is very effective. I did it manually on a test system and had a lot of control reference problems. I will be trying it again to better understand what I missed though this time with a web.config to run a diff against.

Install Net Framework 3.5 SP1

Web.Config Setup

  1. Backup site web.config
  2. Create a 2.0 web app in VS
  3. Copy in web.config
  4. Change target framework to 3.5 and save web.config over production.
  5. Reference: http://weblogs.asp.net/jan/archive/2008/10/10/enabling-net-3-5-in-sharepoint-2007-sites-the-lazy-way.aspx

Add safe control in <Sharepoint><SafeControls> make sure it is 3.5.0.0 (if 3.5 SP1 installed)

  1. Reference: http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3  (see Point 6 )
  2. Reference: http://www.codeproject.com/KB/sharepoint/MossAjaxWebPart.aspx?display=PrintAll&fid=417786&df=90&mpp=25&noise=3&sort=Position&view=Quick&select=2156594

Default.Master

  1. Add SPScriptManager to (default) master page via SPD (Sharepoint Designer)  – here is where to place it.

 <form runat=”server”>

<WebPartPages:SPWebPartManager runat=”Server” />

<asp:ScriptManager runat=”server” ID=”ScriptManager1″>

</asp:ScriptManager>

<TABLE class=”ms-main” CELLPADDING=0 CELLSPACING=0 BORDER=0

WIDTH=”100%” HEIGHT=”100%”>

SPD designer gives a IE 6 warning ?? ignore it

Ajax Web Part

  1. Deploy a simple Ajax Web Part
  2. Reference: http://jamestsai.net/Blog/post/How-To-Create-AJAX-enabled-SharePoint-Web-Part-with-UpdatePanel-and-UpdateProgress-in-10-minutes.aspx
02
Jun
09

#26 Remove Offending WebPart causing a sever error

Occasionally I have ‘friends’ that hammer a page and have a hard time getting back to Kansas.   Recently, I (ahem) my friend added a Ajax WP forgetting to add the ScriptManager to the master page which causes a parse error and you cannot get back into the page via SPD or other means (easily).   You often get a SPD view error jamming you up :

soap:ServerServer was unable to process request. —> A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered as safe on this site. You may not be able to open this page in an HTML editor that is compatible with Microsoft Windows SharePoint Services, such as Microsoft Office SharePoint Designer. To fix this page, contact the site administrator to have the Web Part or Web Form Control configured as safe. You can also remove the Web Part or Web Form Control from the page by using the Web Parts Maintenance Page. If you have the necessary permissions, you can use this page to disable Web Parts temporarily or remove personal settings. For more information, contact your site administrator.

There is a ‘trick’ to view web parts on a page and delete the offender. Go to the Brown Screen of Death page and add ?contents=1 at the end of the URL.  The browser will display (depending on permissions) a maintence view and the Web Parts that are the page – where you can delete the offender.

Credit due: http://www.blogcoward.com/archive/2009/03/29/Sharepoint-Designer-2007-A-Web-Part-or-Web-Form-Control.aspx