Highlighted
shekarls Absent Member.
Absent Member.
1400 views

capture Change of date in QC to set Defect Status

Hi All,

          This is in Defect Module.

if user updates field(ie select a date from the drop down list which is predefined), then i want to sense that change and update defect status field to "Postponed"

 

ie. if a user selects any value from the field BG_User_01, from '01-05-11' to '01-08-11', then set Bug_Fields.Field("BG_USER_31").Value = "Postponed"

 

I am not sure how to include that condition here.

 

<SampleCode>

Sub Defects_Bug_FieldChange(FieldName)
  On Error Resume Next
 
    If Bug_Fields.Field("BG_User_01").Value = "DATE" and Bug_Fields.Field("BG_USER_06").Value = "UAT" then
      set Bug_Fields.Field("BG_USER_31").Value = "Postponed"
   end If

   On Error GoTo 0
End Sub

<SampleCode.

 

How do I sense the change in drop down value in QC?

 

Thanks  in Advance

 

Tags (1)
0 Likes
3 Replies
Knowledge Partner
Knowledge Partner

Re: capture Change of date in QC to set Defect Status

If I understand correctly you mixed two question:

1) you want to change the value of one field based on change of value of another field

2) and maybe to change the lookup list of one field based on another field value

 

All of it are standard thing and you can see the examples in Quali Center Administrator Guide. See example:

"Example: Changing One Field Based on Another Field" and "Example: Presenting a Dynamic Field List on page 400".

 

In you situation I missed the if statement for field name what is good to add because like this the settings is done for changes of all fields:

 

if FieldName = "BG_User_01" then

  If Bug_Fields.Field("BG_User_01").Value = "DATE" and Bug_Fields.Field("BG_USER_06").Value = "UAT" then
      set Bug_Fields.Field("BG_USER_31").Value = "Postponed"
   end If

end if

 

and secondly you have to get the DATE in right format or in date format. Try get the date value try use DateSerial or CDate function like this:

 

  If Bug_Fields.Field("BG_User_01").Value = CDate("01-05-11)

or

  If Bug_Fields.Field("BG_User_01").Value = DateSerial(2011,5,1)

 

For VBScript function download the VBScript help from microsoft.

 

Best Regards

0 Likes
Absent Member.. DB2 Absent Member..
Absent Member..

Re: capture Change of date in QC to set Defect Status

I have a list field with a value "X". If I am to change the value from X to any other value, then the current date should get populated in another field.

 

The code I am using in the FieldChange module is

 

If FieldName = "BG_USER_05" Then

If Bug_Fields.Field("BG_USER_05").Value = "X" Then
  Select case Bug_Fields("BG_USER_05").Value
  case "X"
   Bug_Fields.Field("BG_USER_42").Value = ""
   Bug_Fields.Field("BG_USER_42").IsReadOnly = True
   case Else
  Bug_Fields.Field("BG_USER_42").IsReadOnly = False
  Bug_Fields.Field("BG_USER_42").Value = Date
  Bug_Fields.Field("BG_USER_42").IsReadOnly = True
  End Select
  End If
  End If

 

However, this is not providing the required functionality. Can anyone tell me what I am not doing correctly?

0 Likes
Absent Member.. anuragjalan Absent Member..
Absent Member..

Re: capture Change of date in QC to set Defect Status

You can try below code

 

If Bug_Fields.Field("BG_USER_05").IsModified = True and Bug_Fields.Field("BG_USER_05").Value <> "X" then

Bug_Fields.Field("BG_USER_42").IsReadOnly = False
Bug_Fields.Field("BG_USER_42").Value = TDConnection.Servertime
Bug_Fields.Field("BG_USER_42").IsReadOnly = True

Else

End If

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.