Hi,
My requirement is on performing an action(added button, so clicking on it) should calculate some percentage value based on other fields and place it in one of custom field. Below is the code for the same.
The problem i am facing is when entered into the for loop, it is getting the req id but after that when assigning Req_Fields.Field("RQ_USER_03").Value to some field then its not working. Blank value is displaying. So how to get RQ_USER_03 field value from the ReqId of each requirement.
Function Requirements_ActionCanExecute(ActionName)
On Error Resume Next
Dim EstEffort, ActEffort, Temp, ReqCount, ReqId, ReqList, objReq
Dim i
Requirements_ActionCanExecute = True
If ActionName = "Requirements_Action1" Then
Set tdc = TDConnection
Set ReqFact=tdc.ReqFactory
Set ReqFilter=ReqFact.Filter
Set ReqList = ReqFilter.NewList
Msgbox "ReqList -> " & ReqList.count
For Each theReqfolder In ReqList
Reqid = theReqfolder.id
Msgbox "Reqid -> " & Reqid
EstEffort=Req_Fields.Field("RQ_USER_03").Value 'Assigining Estimation Effort value to EstEffort variable
Msgbox EstEffort
ActEffort=Req_Fields.Field("RQ_USER_05").Value 'Assigining Actual Effort value to ActEffort variable
'Msgbox ActEffort
Temp=(ActEffort/EstEffort)*100 'Calculating the percentage and assigning to Temp variable
'Msgbox Temp
Req_Fields.Field("RQ_USER_06").Value=Round(Temp,2) 'Assigning the Percentage temp value to Devlopment Complete %
'Msgbox Req_Fields.Field("RQ_USER_06").Value
next
End If
On Error GoTo 0
End Function
Thanks