Dim GCHANGE
Function Req_FieldCanChange (FieldName, NewValue)
If FieldName=''RQ_DEV_COMMENTS'' Then
GCHANGE=1
End If
Req_FieldCanChange = True
End Function
Sub Req_AfterPost
On Error Resume Next
If GCHANGE=1 THen
Custom_Notification
End If
On Error GoTo 0
End Sub
Sub Custom_Notification
On Error Resume Next
Dim tdc
Dim objReqFactory
Dim reqlist
GCHANGE=0
Set tdc = TDConnection
Set objReqFactory = tdc.reqFactory
Set ReqFilter = objReqFactory.Filter
pQCAdmin = ''QC_Admin@XYZ.com'' 'Send the email to the Quality Center Administrator
'Change for your own environment
Req_Author = Req_Fields.Field(''RQ_REQ_AUTHOR'').Value
pEmail = tdc.Customization.Users.User(Req_Author).Email
If len(pEmail)<1 Then 'If Requirement Author's email address is blank
pEmail = pQCAdmin 'Send the email to the Quality Center Administrator
Req_Author = pEmail 'Change for your own environment
End If
ReqId = Req_Fields.Field(''RQ_REQ_ID'').Value
ReqFilter.Filter(''RQ_REQ_ID'') = ReqId
Set reqList = ReqFilter.NewList
If (reqList.Count > 0) AND (Req_Fields.Field(''RQ_TYPE_ID'').Value=''Folder'') Then
Set theReq = reqList.Item(1)
strTo = Req_Author
StrSubject = ''Requirement Folder Change NotIfication: '' & ReqId
strComment = strSubject
theReq.Mail strTo,,2,strSubject,strComment 'Send the email
End If
Set tdc = nothing
Set objReqFactory = nothing
Set ReqFilter = nothing
Set reqList = nothing
On Error GoTo 0
End Sub