SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to use Bug_MoveTo

    Hi

    I work with Quality Center (QC) 9.2.

    I need to implement the following functionality:

    If a user is in the defect module – in the list/overall view and focus is on a defect where field “Priority” has value = 3 and user defined field BG_USER_20 is blank, then BG_USER_20 should be set to Required. It should not be possible to leave the defect before BG_USER_20 is set.

    I have made a small script and placed it in the Sub Bug_MoveTo, but it does not work as I hoped. The script looks like this:

    If Bug_Fields.Field("BG_PRIORITY").Value = "3" and _
    Bug_Fields.Field("BG_USER_20").Value = "" Then

    Bug_Fields.Field("BG_USER_20").IsRequired = True

    End if

    If Bug_Fields.Field("BG_USER_20").IsRequired = True Then

    Bug_MoveTo = False

    Else Bug_MoveTo = True

    End if

    I hope this makes sense?

  2. #2
    Advanced Member
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    797
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to use Bug_MoveTo

    1. Bug_MoveTo is a sub, and therefore does not have any output.
    -- this means you can't set it to true or false.. its nonsensical.

    2. _MoveTo fires when you select a record. Setting a field to 'Required' is only validated at _CanPost. This is why you're not seeing anything happen. If you really want to force the user to set a value, then replace your .IsRequired statement with an InputBox

    3. Have you also made BG_USER_20 mandatory when PRIORITY is set?
    <font class="small">Code:</font><hr /><pre>
    Bug_FieldChange:
    If FieldName = "BG_PRIORITY" Then
    If Bug_Fields.Field(FieldName).Value = "3" Then
    Field("BG_USER_20").IsRequired = True
    Else
    Field("BG_USER_20").IsRequired = False
    End If
    End If
    </pre><hr />
    Regards,

    Alex
    ... just another Tester ...

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to use Bug_MoveTo

    Hi Alex

    Thank you for your answer.

    I have this script in Bug_FieldChange - which more or less is the same as the one you posted:

    Sub Bug_FieldChange(FieldName)
    On Error Resume Next
    WizardListCust ' Added by wizard


    If Bug_Fields.Field("BG_PRIORITY").Value = "3" then

    Bug_Fields.Field("BG_USER_20").IsRequired = True

    Else Bug_Fields.Field("BG_USER_20").IsRequired = False

    End if

    On Error GoTo 0
    End Sub

    So yes to your question #3.

    You mentioned an InputBox - I have never worked with that before. Is it possible that you can you give a simple example of how to use an InputBox?

    Best regards
    Thomas

  4. #4
    Advanced Member
    Join Date
    Aug 2004
    Location
    Wellington, New Zealand
    Posts
    797
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Total Downloaded
    0

    Re: How to use Bug_MoveTo

    Untested, but hopefully you get the idea:

    <font class="small">Code:</font><hr /><pre>
    Bug_MoveTo
    If Bug_Fields.Field("BG_PRIORITY").Value = "3" and _
    Bug_Fields.Field("BG_USER_20").Value = "" Then

    Dim UserSays

    Bug_Fields.Field("BG_USER_20").IsRequired = True
    UserSays = Trim(InputBox("BG_USER_20 is empty and it shouldn't be. Please enter an appropriate value here:"))
    Field("BG_USER_20").Value = UserSays
    End If

    </pre><hr />

    VBS InputBox Function @ W3schools
    Regards,

    Alex
    ... just another Tester ...

  5. #5
    Member
    Join Date
    Nov 2008
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to use Bug_MoveTo

    Hi Alex

    Thank you for the VB script and the link. I will take a look at it.

    Thomas

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:34 AM.

Copyright BetaSoft Inc.