Topic
  • 5 replies
  • Latest Post - ‏2014-01-17T09:36:52Z by CQAdmin
cjsasaki
cjsasaki
3 Posts

Pinned topic Put in blank a multiline string

‏2014-01-14T16:42:40Z |

Hi

I have a multiline string field , that I want to reset (put into blank) in the  of a value_change hook of another field.

 

I have tried SetFieldValue fieldname , ""   but it does not worked.
Any suggestions?

 

Thanks

  • GlennSkinner
    GlennSkinner
    58 Posts

    Re: Put in blank a multiline string

    ‏2014-01-14T19:51:59Z  

    Hi

    Would provide more information? What version of clearquest? What client is this ocurring? What is the exact code you are entering? If you are testing on the cqweb, did you mark the field properties to be web aware?

    I created a field called clear_text, a multiline string. I then added a value change hook to another field to clear this multiline string. On 7.1.2.12 clearquest, the value change hook fired and cleared the multiline string as expected. The code I used was:

    SetFieldValue "clear_text", ""

    If you provide further detail, it will help.

     

    Glenn

     

     

     

  • DonaldN
    DonaldN
    287 Posts

    Re: Put in blank a multiline string

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

    Depending on where you put the code, the field may not be refreshed in the ClearQuest client. And you cannot explicitly refresh a field anyway. So you need to understand what a field should be like after a piece of code being executed - they way the product works, not the way you assume it works.

  • cjsasaki
    cjsasaki
    3 Posts

    Re: Put in blank a multiline string

    ‏2014-01-16T21:12:37Z  

    Hi

    Would provide more information? What version of clearquest? What client is this ocurring? What is the exact code you are entering? If you are testing on the cqweb, did you mark the field properties to be web aware?

    I created a field called clear_text, a multiline string. I then added a value change hook to another field to clear this multiline string. On 7.1.2.12 clearquest, the value change hook fired and cleared the multiline string as expected. The code I used was:

    SetFieldValue "clear_text", ""

    If you provide further detail, it will help.

     

    Glenn

     

     

     

    Hi Glenn

    I'm using ClearQuest 8.0.1.00. I'm using ClearQuest Designer for windows.

    Like you I have a multiline string that I want to clear when a "change_value" hook fires in another field.

     

    I just used

    SetFieldValue application, ""

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Put in blank a multiline string

    ‏2014-01-17T09:36:22Z  

    In the below example I have Description as a MultiLine field which is having a default value. And I want to change it to blank if Priority field has a value "1-ResolveImmediately".

     

    Description default Value hook code-

    Dim Dev_template
    crLf = vbCrLf
    Dev_template = "Issue: " & crlf & crlf & crlf & "Steps to Reproduce: " & crlf & "1. " & crlf & "2. " & crlf & "3. " & crlf & "Expected: " & crlf & crlf & "Actual: "
    SetFieldValue "Description", Dev_template

     

    Value Changed Hook Code for the field Priority-

    Dim op_sys
    op_sys = GetFieldValue(fieldname).GetValue()
    If op_sys = "1-Resolve Immediately" Then
    SetFieldValue "Description", ""
    End If

    For the Web client please make sure Priority field (On the forms (Submit and Base forms); double click on Priority field to see the properties) has "Web Dependent Field" as "Description"

  • CQAdmin
    CQAdmin
    103 Posts

    Re: Put in blank a multiline string

    ‏2014-01-17T09:36:52Z  
    • CQAdmin
    • ‏2014-01-17T09:36:22Z

    In the below example I have Description as a MultiLine field which is having a default value. And I want to change it to blank if Priority field has a value "1-ResolveImmediately".

     

    Description default Value hook code-

    Dim Dev_template
    crLf = vbCrLf
    Dev_template = "Issue: " & crlf & crlf & crlf & "Steps to Reproduce: " & crlf & "1. " & crlf & "2. " & crlf & "3. " & crlf & "Expected: " & crlf & crlf & "Actual: "
    SetFieldValue "Description", Dev_template

     

    Value Changed Hook Code for the field Priority-

    Dim op_sys
    op_sys = GetFieldValue(fieldname).GetValue()
    If op_sys = "1-Resolve Immediately" Then
    SetFieldValue "Description", ""
    End If

    For the Web client please make sure Priority field (On the forms (Submit and Base forms); double click on Priority field to see the properties) has "Web Dependent Field" as "Description"

    The Above code/example working fine with CQ 7.1.2 as well as with CQ 8.0.1