locked
Project Server Workflows: providing feedback to user upon error RRS feed

  • Question

  • Hello,

    I am wondering if anyone had to deal with something that I'm going to describe below and had any solutions.  The scenario is the following: a user enters resource name(s) in a custom field, comma-delimited if more than one resource, then the ReadResource method is used to get necessary information about the resource.  The problem is the following: since a nifty Active Directory validation is not available with PS custom fields, it has to be done through code.  Sure I can check whether ReadResource returned any rows and/or catch IndexOutOfRange exception, but we don't want an exception to be thrown or the code to continue with no resource information.  Somehow we want to give feedback to the user that one of the resources' names was entered incorrectly and have them try again.  Appears that MessageBox cannot be used, since this is not Windows Form and from researching it doesn't seem like it's possible to give such kind of feedback to the user and have the workflow wait until all names are validated.

    Note: reading PS Security Groups is not an option due to the business requirements.

    Would appreciate any input!

    Thank you,
    Ilya

    Friday, September 30, 2011 5:38 PM

Answers

  • One method I have used previously (actually it is used extensively in the Solution Starters, the Infopath Form Viewer for example) is to hook onto the PDP Save event and then run some additional code, this would allow you have immediate validation and feedback on that page in a webpart which is possibly empty unless an error is found?

     

    Not something I've done for workflow specifically, but I'm sure it would would for you with some custom dev.

    Martin.


    Martin Laukkanen (Project Server Blog - www.nearbaseline.com/blog)
    • Proposed as answer by Martin Laukkanen Sunday, October 23, 2011 9:57 PM
    • Marked as answer by Rockmus Monday, October 24, 2011 4:09 PM
    Thursday, October 6, 2011 10:09 PM

All replies

  • Hi,

    I think the best you can do is to validate the field with code after the user submit's, and if it fails the check then return the workflow to the previous stage perhaps with that field blanked out or something?

     

    HTH,


    Martin Laukkanen (Project Server Blog - www.nearbaseline.com/blog)
    Wednesday, October 5, 2011 10:08 PM
  • Martin,

    Very good suggestion, thank you.  However, I can forsee user experience problem with this solution.  Whenever something that doesn't allow much UI tweaking is deployed to a large group of users, you can almost always expect them not understandning why they are seeing what they are seeing.  I'm still talking about providing feedback about why the stage did not advance.  I'm sure something could be arranged with updating stage status and maybe a while loop until all resources validate, but, even with that and blanking the field out, I don't think we are going to have a smooth process.

    Message Box would be ideal.  Project Server Workflows do show you messages from time to time, like on Submit for instance, how do they do that?  Is that available to custom code at all?

    Thank you,
    Ilya

    • Marked as answer by Rockmus Monday, October 24, 2011 4:09 PM
    • Unmarked as answer by Rockmus Monday, October 24, 2011 4:09 PM
    Thursday, October 6, 2011 5:25 PM
  • One method I have used previously (actually it is used extensively in the Solution Starters, the Infopath Form Viewer for example) is to hook onto the PDP Save event and then run some additional code, this would allow you have immediate validation and feedback on that page in a webpart which is possibly empty unless an error is found?

     

    Not something I've done for workflow specifically, but I'm sure it would would for you with some custom dev.

    Martin.


    Martin Laukkanen (Project Server Blog - www.nearbaseline.com/blog)
    • Proposed as answer by Martin Laukkanen Sunday, October 23, 2011 9:57 PM
    • Marked as answer by Rockmus Monday, October 24, 2011 4:09 PM
    Thursday, October 6, 2011 10:09 PM
  • Thanks, Martin.  Haven't really played with events before or web parts for that matter.  Do you know of good examples of custom dev with web parts?  For instance, which web part would you use in this case and how to populate it, or communicate with it in general?

    Thanks,
    Ilya

    Friday, October 21, 2011 6:06 PM
  • Hi,

    Have a look at the solution starters http://archive.msdn.microsoft.com/P2010SolutionStarter, some of them like the InfoPath Form viewer do hook into the ribbon button events so you can get some code ideas from those.

     

    Regards,


    Martin Laukkanen (Project Server Blog - www.nearbaseline.com/blog)
    Sunday, October 23, 2011 9:57 PM