SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 8 of 8

Thread: Quality Center

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Quality Center

    Hi, an intermittent error "Just-In- Time Debugging" window appears when I try to add values in two fields together. It then says a failure has occurred in the workflow script referring to type mis-match "Csng". Does anyone know how this problem might be resolved?
    Regards,
    Colm

  2. #2
    Member
    Join Date
    Sep 2008
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Quality Center

    First guess - when the error occurs there is either invalid data or a null / space in one of the fields. Multiple options to fix - first suggestion - filter the fields to make sure they contain valid data. second suggestion - set both fields to zero before you move any application / workflow data to them to be sure the fields don't hold a null or space.

  3. #3
    Member
    Join Date
    Feb 2009
    Location
    Ohio
    Posts
    47
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Quality Center

    What are the field types? I use something similar using numeric fields and then just do something like this in my functions.

    Req_Fields.Field("RQ_USER_03").Value = Req_Fields.Field("RQ_USER_01").Value + Req_Fields.Field("RQ_USER_02").Value
    -------------
    Thanks,

    Bernard Szymczak

  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: Quality Center

    Are you trying to concatenate string values?
    It looks like you might have typed Csng instead of CStr

    For example:
    Req_Fields.Field("RQ_USER_03").Value = cStr(Req_Fields.Field("RQ_USER_01").Value) & " " & cStr(Req_Fields.Field("RQ_USER_02").Value)
    Regards,

    Alex
    ... just another Tester ...

  5. #5
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Quality Center

    Hi, I meant to say the field types we are using are string as opposed to number. We want to use string field types as these cater for decimals as well as integers. But to add numeric values using these field types together, the code below is required. But the types mismatch Csng error sometimes comes up if a value that isn't an integer or decimal is typed in. we have validation code to cater for this, but the correct validation message box only sometimes comes up. The rest of the time, the type mismatch error appears.

    Dim MyVar : MyVar = Csng(Bug_Fields.Field("BG_USER_13").Value) + Csng(Bug_Fields.Field("BG_USER_15").Value) + _
    Csng(Bug_Fields.Field("BG_USER_02").Value)

    Bug_Fields.Field("BG_USER_32").Value = CStr(Round (myVar, 2))

  6. #6
    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: Quality Center

    Can you post your code?
    Regards,

    Alex
    ... just another Tester ...

  7. #7
    Junior Member
    Join Date
    Jul 2011
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Quality Center

    Hi,code is below.

    Select Case Fieldname

    Case "BG_USER_13"
    Bug_Fields("BG_USER_32").IsReadOnly = False
    If IsNumeric(Bug_Fields.Field("BG_USER_13").Value) Then
    Bug_Fields("BG_USER_32").IsReadOnly = False

    Dim MyVar : MyVar = Csng(Bug_Fields.Field("BG_USER_13").Value) + Csng(Bug_Fields.Field("BG_USER_15").Value)

    Bug_Fields.Field("BG_USER_32").Value = CStr(Round (myVar, 2))
    Bug_Fields("BG_USER_32").IsReadOnly = True
    Else MsgBox "Please enter a numeric value"
    Bug_Fields.Field("BG_USER_13").Value = LastValue("BG_USER_13", "Defects")
    End If

    Case "BG_USER_15"
    Bug_Fields("BG_USER_32").IsReadOnly = False
    If IsNumeric(Bug_Fields.Field("BG_USER_15").Value) Then
    Bug_Fields("BG_USER_32").IsReadOnly = False


    Dim MyVar1 : MyVar1 = Csng(Bug_Fields.Field("BG_USER_13").Value) + Csng(Bug_Fields.Field("BG_USER_15").Value)

    Bug_Fields.Field("BG_USER_32").Value = CStr(Round (myVar1, 2))
    Bug_Fields("BG_USER_32").IsReadOnly = True
    Else MsgBox "Please enter a numeric value"
    Bug_Fields.Field("BG_USER_15").Value = LastValue("BG_USER_15", "Defects")
    End If
    End Select

    Regards,

    Colm

  8. #8
    Junior Member
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    7
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Quality Center

    Hi,
    from what I see there is no check whether the fields "BG_USER_13" and/or "BG_USER_15" are empty and both are numeric....
    Regards
    Jo

 

 

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 9.38%
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 06:51 PM.

Copyright BetaSoft Inc.