Topic
  • 4 replies
  • Latest Post - ‏2014-01-28T16:18:26Z by melshah
melshah
melshah
72 Posts

Pinned topic checkbox validation during action not working

‏2014-01-27T21:17:56Z |

Hello,

I want to check the checkbox value for code_review during  development_complete action if the vlaue is 1 i wan to make Peer_Reviewd_by field Mandatory

checkbox vaule i am using are constant 0 and 1 ( 0 for unchecked)

on development_complete Action--> validation i have the below code but  the code is firing as required  but the field is not  getting mandatory

Appreciate any help

     IF ( GetFieldValue("Peer_Review").GetValue() = 1) Then
        set sessionObj = GetSession
        sessionObj.OutputDebugString " Peer review not checked."
        SetFieldRequirednessForCurrentAction "Peer_Reviewed_by", AD_MANDATORY
           
     End If

Updated on 2014-01-27T21:46:58Z at 2014-01-27T21:46:58Z by melshah
  • DonaldN
    DonaldN
    286 Posts

    Re: checkbox validation during action not working

    ‏2014-01-27T23:33:16Z  

    If I remember correctly, before a checkbox is "touched", it has no value. In your case, unless the check box is clicked at least once, its value is either 0 or 1. You need to be a bit more creative to enforce the process (probably by using a default value).

  • CQAdmin
    CQAdmin
    103 Posts

    Re: checkbox validation during action not working

    ‏2014-01-28T04:20:52Z  

    Your code is working fine in my setup.

    If I am checking the "CheckBox" (using Modify action) and then performing "development_complete" action; "Peer_Reviewed_by" field is becoming Mandatory.

    CheckBox Default Value is "0"

    And I have a Constant list containing two values "0" and "1"

     

  • melshah
    melshah
    72 Posts

    Re: checkbox validation during action not working

    ‏2014-01-28T15:32:34Z  
    • CQAdmin
    • ‏2014-01-28T04:20:52Z

    Your code is working fine in my setup.

    If I am checking the "CheckBox" (using Modify action) and then performing "development_complete" action; "Peer_Reviewed_by" field is becoming Mandatory.

    CheckBox Default Value is "0"

    And I have a Constant list containing two values "0" and "1"

     

    Hi

     

    Do i need to have a constant list with  0 and 1 value. ?

    what i have is for field Peer_Review --->default value --> constant--> set to 0

    in form for Peer_Review--Properties---extended --checked value=1 and unchecked value=0

     

  • melshah
    melshah
    72 Posts

    Re: checkbox validation during action not working

    ‏2014-01-28T16:18:26Z  
    • melshah
    • ‏2014-01-28T15:32:34Z

    Hi

     

    Do i need to have a constant list with  0 and 1 value. ?

    what i have is for field Peer_Review --->default value --> constant--> set to 0

    in form for Peer_Review--Properties---extended --checked value=1 and unchecked value=0

     

    i see the issue was  i did not have double quotes "1"  in the below line as  i had the checkbox field has short string . after the double quotes it worked fine

    IF ( GetFieldValue("Peer_Review").GetValue() = "1") Then