This project is read-only.

task control problem

Feb 9, 2009 at 9:40 PM
hi,

I have a problem using Task Controls, my wf creates a task for the user, then when i go to "edit" in the created task i keep getting "The control with ID 'FormPlaceHolder' requires content. " I have checked everything but can't find the problem. Note that my AssociationForm works fine, i have followed all the steps from the videos and also from other websites, PLEASE HELP!

thanks!

Feb 9, 2009 at 9:50 PM
Could you send the metadata fragment of your workflow.xml file?

Chris
Feb 9, 2009 at 10:00 PM
    <MetaData>
      <Association_FormUrl>/_controltemplates/WorkflowsIA/Asociacion.ascx</Association_FormUrl>
      <Task_0FormUrl>/_controltemplates/WorkflowsIA/AprobacionGerente.ascx</Task_0FormUrl>
      <Task_1FormUrl>/_controltemplates/WorkflowsIA/AprobacionGerente.ascx</Task_1FormUrl>
      <Task_2FormUrl>/_controltemplates/WorkflowsIA/EditarSolicitud.ascx</Task_2FormUrl>
      <Task_3FormUrl>/_controltemplates/WorkflowsIA/RecepcionServicioContabilidad.ascx</Task_3FormUrl>
      <Task_4FormUrl>/_controltemplates/WorkflowsIA/RecepcionServicioJefeArea.ascx</Task_4FormUrl>
      <Task_5FormUrl>/_controltemplates/WorkflowsIA/PagoProveedor.ascx</Task_5FormUrl>
</MetaData>

I am using WSS 3.0 on Windows Server 2008, thanks Chris
Feb 9, 2009 at 10:07 PM
Change your Task_nFormUrl metadata entries to Task_n_FormUrl entries.  That should fix the problem.

Chris
Feb 9, 2009 at 10:26 PM
Thanks Chris, but now i get "Unknown Error", i don't now what's wrong...

nico
Feb 9, 2009 at 10:32 PM
I would guess that what's happening is related to an error in your task form.  Since the metadata is now correct, it's loading the page and finding a problem in the .ascx file.  The easiest way to debug this is to update your web.config file on the sharepoint site to display error information.  Check out this blog entry for information on how to do this.


Once you have debugging enabled, the error message should be a little more descriptive than "Unknown Error".  If the better error still isn't helpful, let me know.

Chris
Feb 10, 2009 at 5:48 PM
Chris,

Now i'm getting:

c:\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES\WFA\AprobacionJA.ascx(157): error CS0117: 'ASP._controltemplates_workflowsinversioneselalto_aprobacionjefearea_ascx' does not contain a definition for 'Web'   at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) ...

the code is:

Microsoft.SharePoint.SPListItem sol = this.Web.Lists["ListadoRequerimientos"].Items[idSolicitud];

how can i access the sharepoint list from the TaskControl? .The WF application i'm working was running fine in Windows Server 2003, did i need to change anything to make it work on Server 2008?

thanks Chris, saludos desde Chile.
-nico
Feb 10, 2009 at 6:10 PM
The reason this is failing is due to the fact that 'this' in the context you're using it is tied to the .ascx control, not the page.  The simplest solution would be to use the SPContext object and do this.

SPListItem sol = SPContext.Current.Web.Lists["ListadoRequerimientos"].Items[idSolicitud];

This is assuming that you're accessing a list other than the one the workflow is executing on.  Another option is to cast the Page property to a ListWorkflowPage and use the properties on this.  Let me know how this works out for you.  Based on your experiences, we may decide that it's better to add a direct connection between the control and it's hosting page to better facilitate your scenario.

Chris
Feb 12, 2009 at 1:06 PM
Chris, list i was trying to access is the same that the workflow is executing on, anyway, your solution worked fine to access that and other lists, thanks!

-nico