|
鲜花~~~~- '第1步:
- '在workfolw中, 声明下列变量
- Dim blnAddCommentClicked
- Dim strCommentBeforeUpdate
- Dim blnUpdateCommentError:blnUpdateCommentError = False
- Dim changed:changed = false
- '第2步:
- Function Defects_ActionCanExecute(ActionName)
- On Error Resume Next
- If ActionName = "BugAddDevCommentsAction1" Then
- blnAddCommentClicked = True
- End If
- Defects_ActionCanExecute = Project_DefaultRes
- On Error GoTo 0
- End Function
- '第3步:
- Function Defects_Bug_FieldCanChange(FieldName, NewValue)
- On Error Resume Next
- if not changed then
- strCommentBeforeUpdate = Bug_Fields("BG_DEV_COMMENTS").Value
- end if
- If FieldName = "BG_DEV_COMMENTS" and blnAddCommentClicked = False Then
- Msgbox "不能更新注释." & Chr(13)& "无法保存更新."&Chr(13)&" 请通过[添加注释]按钮添加注释."
- blnUpdateCommentError = true
- blnAddCommentClicked = False
- changed = true
- End If
- Defects_Bug_FieldCanChange = Project_DefaultRes
- On Error GoTo 0
- End Function
- '第4步:
- Function Defects_Bug_CanPost
- On Error Resume Next
- If blnUpdateCommentError And Not blnAddCommentClicked Then
- Bug_Fields("BG_DEV_COMMENTS").Value = strCommentBeforeUpdate
- blnUpdateCommentError = False
- End If
- blnAddCommentClicked = False
- changed = false
- Defects_Bug_CanPost = Project_DefaultRes
- On Error GoTo 0
- End Function
复制代码
[ 本帖最后由 joshfang 于 2008-5-27 15:32 编辑 ] |
|