Hi
Here's the code:
The purpose of the code is to traverse a database of product defects information and invoke 'send_reminder' action of external tool clearquest for defects more than 30days old that remain unresolved. I am facing difficulty in invoking the send_reminder function for a test temporary charm(i.e defect). The errror I receive is:
Public member 'IOAdEntityActionHookEvents_NotificationEventHandler' on type '_ComObject' not found.
How do I fix this??
OptionStrictOff
OptionExplicitOn
Module Module1
PublicSub Main()
Dim Status AsObject
Dim num_records AsObject
Dim SessionObj AsObject
Dim Charm AsObject
Dim S AsObject
Dim A AsObject
'Dim v As String
Dim res AsObject
Dim tmpCharmID AsString
tmpCharmID = "NMG_00027675"
SessionObj = CreateObject("CLEARQUEST.SESSION")
res = SessionObj.UserLogon("temp", "password", "NMG_", 0, "")
Dim Resultset As ClearQuestOleServer.OAdResultset
Resultset = SessionObj.BuildSQLQuery("select distinct T1.id,T2.name,T1.mess_date,T1.prod_proc,T1.ext_db,T1.ext_flag,T1.ext_id,T1.remain_name,T1.real_version,T1.priority,T1.keyword_1,T1.keyword_2,T1.arch_version,T1.caused_in,T1.estimated_effort,T1.found_in,T1.last_update,T1.label,T1.solution_date,T1.summary,T1.type_,T1.validation_date,T1.reproducible,T1.is_duplicate,T1.Serial_No,T1.Sec_ID, T1.category, T1.solution_name, T1.mess_name, T1.mess_dept, T1.remain_dept from Defect T1,statedef T2,rr_alias_client T19,rr_alias_default T20,rr_alias_product T21 where T1.state = T2.id and T1.client_access = T19.dbid and T1.default_access = T20.dbid and T1.product_access = T21.dbid and (T1.dbid <> 0) and ((T19.dbid in (-1)) or (T20.dbid in (33554502)) or (T21.dbid in (-1))) and T1.summary like '%CRB%' and T1.remain_name <> 'CC_DHB' and dateadd(d,31,T1.last_update) < '" & System.DateTime.Today.ToString & "' and (T2.name = 'in_work' or T2.name = 'in_decision' or T2.name = 'submitted')")
Resultset.Execute()
Try
'Open "C:\Defect_dump_scripts\data\all_defects_cumulative.csv" For Output As #2
FileOpen(2, "C:\Defects_Metrics\all_defects_cumulative.csv", OpenMode.Output)
Catch ex As System.IO.DirectoryNotFoundException
' Let the user know that the directory did not exist.
Console.WriteLine("Directory not found: " + ex.Message)
EndTry
num_records = 0
Status = Resultset.MoveNext
PrintLine(2, "id, State, Mess_Date, Prod_Proc, Ext_Db, Ext_Flag, Ext_ID, Remain_Name, Real_Version, Priority, Keyword_1, Keyword_2, Arch_Version, Caused_In, Estimated_Effort, Found_In, Last_Update, Label, Solution_Date, Summary, Type, Validation_Date, Reproducble, is_duplicate, Serial_No, Sec_ID, Category, Solution_Name, Mess_Name, Mess_Dept, Remain_Dept")
Dim line AsString
num_records = num_records + 1
Charm = SessionObj.GetEntity("Defect", tmpCharmID)
A = Charm.GetFieldValue("summary").getValue()
'A = Charm.GetActionName(15)
'S = CreateObject("ClearQuestOleServer.IOAdEventObject")
' A = Charm2.GetActionDefForm("Send_Reminder")
S = SessionObj.IOAdEntityActionHookEvents_NotificationEventHandler.Invoke("Send_Reminder", 15)
'v = Charm.GetActionType()
MsgBox(A, MsgBoxStyle.OkOnly, "Passes Test")
line = "" & Replace(CStr(Resultset.GetColumnValue(1)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(2)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(3)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(4)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(5)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(6)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(7)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(8)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(9)), ",", " ") & "," & CStr(Resultset.GetColumnValue(10)) & "," & CStr(Resultset.GetColumnValue(11)) & "," & Replace(CStr(Resultset.GetColumnValue(12)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(13)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(14)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(15)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(16)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(17)), ",", " ") & ","
line = line & Replace(CStr(Resultset.GetColumnValue(18)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(19)), ",", " ") & "," & Replace(Replace(CStr(Resultset.GetColumnValue(20)), """", " "), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(21)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(22)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(23)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(24)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(25)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(26)), ",", " ")
PrintLine(2, "" & line)
Status = Resultset.MoveNext
'Loop
FileClose(2)
EndSub
EndModule
Here's the code:
The purpose of the code is to traverse a database of product defects information and invoke 'send_reminder' action of external tool clearquest for defects more than 30days old that remain unresolved. I am facing difficulty in invoking the send_reminder function for a test temporary charm(i.e defect). The errror I receive is:
Public member 'IOAdEntityActionHookEvents_NotificationEventHandler' on type '_ComObject' not found.
How do I fix this??
OptionStrictOff
OptionExplicitOn
Module Module1
PublicSub Main()
Dim Status AsObject
Dim num_records AsObject
Dim SessionObj AsObject
Dim Charm AsObject
Dim S AsObject
Dim A AsObject
'Dim v As String
Dim res AsObject
Dim tmpCharmID AsString
tmpCharmID = "NMG_00027675"
SessionObj = CreateObject("CLEARQUEST.SESSION")
res = SessionObj.UserLogon("temp", "password", "NMG_", 0, "")
Dim Resultset As ClearQuestOleServer.OAdResultset
Resultset = SessionObj.BuildSQLQuery("select distinct T1.id,T2.name,T1.mess_date,T1.prod_proc,T1.ext_db,T1.ext_flag,T1.ext_id,T1.remain_name,T1.real_version,T1.priority,T1.keyword_1,T1.keyword_2,T1.arch_version,T1.caused_in,T1.estimated_effort,T1.found_in,T1.last_update,T1.label,T1.solution_date,T1.summary,T1.type_,T1.validation_date,T1.reproducible,T1.is_duplicate,T1.Serial_No,T1.Sec_ID, T1.category, T1.solution_name, T1.mess_name, T1.mess_dept, T1.remain_dept from Defect T1,statedef T2,rr_alias_client T19,rr_alias_default T20,rr_alias_product T21 where T1.state = T2.id and T1.client_access = T19.dbid and T1.default_access = T20.dbid and T1.product_access = T21.dbid and (T1.dbid <> 0) and ((T19.dbid in (-1)) or (T20.dbid in (33554502)) or (T21.dbid in (-1))) and T1.summary like '%CRB%' and T1.remain_name <> 'CC_DHB' and dateadd(d,31,T1.last_update) < '" & System.DateTime.Today.ToString & "' and (T2.name = 'in_work' or T2.name = 'in_decision' or T2.name = 'submitted')")
Resultset.Execute()
Try
'Open "C:\Defect_dump_scripts\data\all_defects_cumulative.csv" For Output As #2
FileOpen(2, "C:\Defects_Metrics\all_defects_cumulative.csv", OpenMode.Output)
Catch ex As System.IO.DirectoryNotFoundException
' Let the user know that the directory did not exist.
Console.WriteLine("Directory not found: " + ex.Message)
EndTry
num_records = 0
Status = Resultset.MoveNext
PrintLine(2, "id, State, Mess_Date, Prod_Proc, Ext_Db, Ext_Flag, Ext_ID, Remain_Name, Real_Version, Priority, Keyword_1, Keyword_2, Arch_Version, Caused_In, Estimated_Effort, Found_In, Last_Update, Label, Solution_Date, Summary, Type, Validation_Date, Reproducble, is_duplicate, Serial_No, Sec_ID, Category, Solution_Name, Mess_Name, Mess_Dept, Remain_Dept")
Dim line AsString
num_records = num_records + 1
Charm = SessionObj.GetEntity("Defect", tmpCharmID)
A = Charm.GetFieldValue("summary").getValue()
'A = Charm.GetActionName(15)
'S = CreateObject("ClearQuestOleServer.IOAdEventObject")
' A = Charm2.GetActionDefForm("Send_Reminder")
S = SessionObj.IOAdEntityActionHookEvents_NotificationEventHandler.Invoke("Send_Reminder", 15)
'v = Charm.GetActionType()
MsgBox(A, MsgBoxStyle.OkOnly, "Passes Test")
line = "" & Replace(CStr(Resultset.GetColumnValue(1)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(2)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(3)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(4)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(5)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(6)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(7)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(8)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(9)), ",", " ") & "," & CStr(Resultset.GetColumnValue(10)) & "," & CStr(Resultset.GetColumnValue(11)) & "," & Replace(CStr(Resultset.GetColumnValue(12)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(13)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(14)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(15)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(16)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(17)), ",", " ") & ","
line = line & Replace(CStr(Resultset.GetColumnValue(18)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(19)), ",", " ") & "," & Replace(Replace(CStr(Resultset.GetColumnValue(20)), """", " "), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(21)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(22)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(23)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(24)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(25)), ",", " ") & "," & Replace(CStr(Resultset.GetColumnValue(26)), ",", " ")
PrintLine(2, "" & line)
Status = Resultset.MoveNext
'Loop
FileClose(2)
EndSub
EndModule