none
How to use CompareProjectProperty conntrol in Branching workflow to check the value of custom field?? RRS feed

  • Question

  • Hii everyone,

    i want to develop a Branching workflow for Project server 2010,there is a very simple condition that i need to implement,but i am not getting success in it,i am following example as given by microsoft

    http://msdn.microsoft.com/en-us/library/ee767701.aspx

    what my reqiurement is that, there is a custom field which takes it value from lookup table,values inside that custom field are Yes/NO,I have associated that custom field with PDP,now what i need is that when user selects Yes value in that custom field workflow should move to next stage and if user selects NO,workflow should terminate

    i have done all the things by Following the link above,but i am not sure How to use CompareProjectProperty to check what value is placed in that custom field(yes/no),what i have done is in MdPropUid  i have given the guid of my custom field(yes/no),and in compare operator i have selected Equal to,and in TextProperty value,i have typed Yes,rest all the things are same as specified in example above in the link,but i am not getting success,my workflow is terminating in both the cases whether i select yes or no, if anyone has any idea plz lemme know,any help will be greatly appreciated


    Tuesday, February 21, 2012 12:43 PM

Answers

  • Anuj,

    Since you are comparing a lookup table value, you have to use CodePropertyValue property instead of TextPropertyValue.  The latter is used when you have a plain text field.  So blank out your TextPropertyValue and populate the CodePropertyValue with the GUID of the Yes or No lookup table choice (depending on your logic).  You may obtain that GUID by going into Server Settings -> Enterprise Fields and LookupTables, open the lookup table, click on either Yes or No choice and you should see the GUID in System Identification Data section below.

    Note: the lookup table itself has a differen GUID and each value contained in the lookup table is assigned its own GUID.  So make sure you put the right one in there.

    Hope that helps,
    Ilya

    P.S. I've noticed that Not Equal To operator does not work on string values when comparing lookup table entries.  Use Does Not Contain instead if you must.  But you are using EqualsTo, so that shouldn't be a problem.

    • Proposed as answer by Rockmus Wednesday, February 22, 2012 6:09 PM
    • Marked as answer by anuj astro Thursday, February 23, 2012 5:43 AM
    Wednesday, February 22, 2012 5:55 PM

All replies

  • Anuj,

    Since you are comparing a lookup table value, you have to use CodePropertyValue property instead of TextPropertyValue.  The latter is used when you have a plain text field.  So blank out your TextPropertyValue and populate the CodePropertyValue with the GUID of the Yes or No lookup table choice (depending on your logic).  You may obtain that GUID by going into Server Settings -> Enterprise Fields and LookupTables, open the lookup table, click on either Yes or No choice and you should see the GUID in System Identification Data section below.

    Note: the lookup table itself has a differen GUID and each value contained in the lookup table is assigned its own GUID.  So make sure you put the right one in there.

    Hope that helps,
    Ilya

    P.S. I've noticed that Not Equal To operator does not work on string values when comparing lookup table entries.  Use Does Not Contain instead if you must.  But you are using EqualsTo, so that shouldn't be a problem.

    • Proposed as answer by Rockmus Wednesday, February 22, 2012 6:09 PM
    • Marked as answer by anuj astro Thursday, February 23, 2012 5:43 AM
    Wednesday, February 22, 2012 5:55 PM
  • thanx a lot,rockmus,it worked,thanx again
    Thursday, February 23, 2012 5:44 AM
  • No problem :)
    Monday, February 27, 2012 9:33 PM
  • and what if the Custom Field has not lookup table associated but a flag field??

    How can you compare the Property?

    In DB looks like 0 or 1, but the first time passing by the comparison the workflow dosen't move forward.

    If I changed the value from No to Yes and then again to No, when restarting the workflow goes smoothly

    Any idea?

    THANKS!

    Tuesday, September 11, 2012 4:47 PM