none
Unitialized custom fields in Project Server 2013 Workflow RRS feed

  • Question

  • Hi:

    I'm working on a Project Server 2013 Workflow using SharePoint Designer and I'm having some trouble doing some validation in the workflow. Here is my scenario:

    - Project Server 2013 with SP1 in Spanish.

    - Custom Field "Cancel the project?" of Flag type, not mandatory and not workflow controlled.

    - Two Project Detail Pages, one "Project Data" with the main project information (without the Flag field) and the other "Cancellation" with the Flag field.

    - In the Workflow I have two stages, the first one that check MyFlag field to decide to do some tasks if the flag is No, or to go to a second stage where I will change the project Status to "Cancelled" (Status is another custom field) if the flag is Yes.

    As you can see, only in the case that the user wants to cancel his project he should go to the "Cancellation" page, otherwise he doesn't need to enter there. I tested the cancellation use case and it is working perfectly as the user goes to the "Cancellation" page, set the "Cancel the project?" field to Yes and save the project. However, if I try the normal use case, as the user doesn't enter the "Cancellation" page, the workflow is throwing some errors:

    RequestorId: a2ef8b5a-21bb-62f4-839f-f3cedbf5f811. Details: System.ApplicationException: HTTP 500 {"error":{"code":"-1, Microsoft.SharePoint.Client.UnknownError","message":{"lang":"es-ES","value":"Error desconocido"}}} {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["114"],"SPRequestGuid":["369bd2e8-6734-4965-8185-7a40b42fd657"],"request-id":["369bd2e8-6734-4965-8185-7a40b42fd657"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4551"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Thu, 17 Sep 2015 14:33:16 GMT"],"Server":["Microsoft-IIS\/7.5"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

    The ULS shows the following:

    Exception occured in scope Microsoft.ProjectServer.WorkflowActivities.ReadBooleanProperty. Exception=System.NullReferenceException: Object reference not set to an instance of an object.    
     at Microsoft.ProjectServer.WorkflowActivities.ReadBooleanProperty(Guid projectId, String propertyId)    
     at Microsoft.ProjectServer.WorkflowActivitiesServerStub.ReadBooleanProperty_MethodProxy(WorkflowActivities target, ClientValueCollection xmlargs, ProxyContext proxyContext)    
     at Microsoft.ProjectServer.WorkflowActivitiesServerStub.InvokeMethod(Object target, String methodName, ClientValueCollection xmlargs, ProxyContext proxyContext, Boolean& isVoid)    
     at Microsoft.SharePoint.Client.ServerStub.InvokeMethodWithMonitoredScope(Object target, String methodName, ClientValueCollection args, ProxyContext proxyContext, Boolean& isVoid)

    I'm assuming the error appears because the flag field is not initialized, but I don't see how I can do this from the workflow without showing the flag field in the general page. There is no default value setting for the flag field. I've tried changing it to workflow controlled but I received the same error. Any help would be appreciated.

    Regards,

    Gustavo 

    Thursday, September 17, 2015 2:57 PM

Answers

  • Hi Gustavo,

    The field is not initialized and that's why you are getting the error. Have you tried setting the value to Yes, then Save and then set it back to No and see if it works that way?

    I would suggest using a lookup table custom field (Yes, No), with No as default and mandatory in that particular stage. This way you make sure there is a value for that field.

    Hope this helps

    Paul

    Thursday, September 17, 2015 3:47 PM

All replies

  • Hi Gustavo,

    The field is not initialized and that's why you are getting the error. Have you tried setting the value to Yes, then Save and then set it back to No and see if it works that way?

    I would suggest using a lookup table custom field (Yes, No), with No as default and mandatory in that particular stage. This way you make sure there is a value for that field.

    Hope this helps

    Paul

    Thursday, September 17, 2015 3:47 PM
  • Thanks Paul, the workaround works fine. I created a new field using a lookup table with the default in "No" and it worked for both scenarios.

    Regards,

    Gustavo

    Thursday, September 17, 2015 6:28 PM