SPONSORS:






User Tag List

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

    Usage of filter condition

    Hi All,

    I need to filter list of actual efforts spent, with respect to the condition using file factory method. I have written a sample code below.

    I wanted filter a value based on the condition, how we can do the same. In the below code Iím not getting any values for message box (for variable b).

    Dim bglist, a, b

    Set f = TDConnection.BugFactory
    f.Filter ("BG_DETECTED_IN_RCYC") = "=1035"
    set bglist = f.NewList("")
    for each a in bglist
    b = a.Field("BG_DETECTED_IN_RCYC")
    msgbox b

    Next

    Note,"BG_DETECTED_IN_RCYC" is NUMBER FIELD.I NEED TO FILTER based on the condition.

    Thank You

    Best Regards,
    Nell

  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: Usage of filter condition

    try:
    b = a.Field("BG_DETECTED_IN_RCYC").Value
    Regards,

    Alex
    ... just another Tester ...

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

    Re: Usage of filter condition

    Asher,

    I tried this, but it has not given me the result.

    Hence can you please help me on the same...

    Thank You

    Best Regards,
    Nell

  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: Usage of filter condition

    What does bglist.count return?
    Your filter looks wrong to me but I'm not in a position to test/try anything.

    Here's an attempt off the top of my head...

    <font class="small">Code:</font><hr /><pre>
    Set f= TDConnection.BugFactory
    Set BugFilter = f.Filter
    BugFilter.Filter("BG_DETECTED_IN_RCYC")= 1035

    Set bglist = f.NewList

    For each a in bglist
    b = a.Field("BG_DETECTED_IN_RCYC")
    msgbox b
    Next
    </pre><hr />
    Regards,

    Alex
    ... just another Tester ...

  5. #5
    Advanced Member cgrzelka's Avatar
    Join Date
    Feb 2005
    Location
    Bordeaux, France
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Usage of filter condition

    Three problems here :

    1. The definition of filter criteria for the TDFilter (e.g. BugFactory.Filter) objects is the same as the one in the QC user interface. So, instead of giving the cycle id, give the cycle path : ^Release Folder\Release\Cycle^. You can use the filter definition window in the Defects module to get the exact value.

    2. The NewList method should be applied to the TDFilter object, not the factory one.

    3. Once you get the bug list, the Field property of each bug gives you access to the defect fields. When a field is "simple" (a string, a number or a date) the Field("xxx") property gives you a value of that type (a String, a Long, a Date). When the field is a foreign key (i.e. the ID of another QC "entity"), the Field("xxx") property returns an object for that entity class. In your case, Field ("BG_DETECTED_IN_RCYC") returns a Cycle object. To get its name, you should use b = a.Field("BG_DETECTED_IN_RCYC").Name.

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

    Re: Usage of filter condition

    Thanks for your response.

    i have one querly like SQL can we join two file factory at a time.

    example: bugfactory with releasefolderfactory, is there any way...

    Best Regards,
    Nell

  7. #7
    Member
    Join Date
    Mar 2012
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Usage of filter condition

    Hi,
    How can we use additional AND / OR / IN / NOT IN additional filters for the same query.
    Is the same possible
    Say one wants to find list of 'open or closed' defects
    'Something on the below mentioned lines
    'I want to try additional filtering on the same field
    oBugFilter1.Filter("BG_STATUS") = "Closed" OR "Open"

    Thanks

 

 

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 10.00%
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 10:42 AM.

Copyright BetaSoft Inc.