0
我正在使用HP ALM API從數據庫中獲取字段。問題在於它可能會發生,該字段在項目中不存在,每當發生這種情況時,我都會收到錯誤信息。檢查VBScript中是否存在對象
如何正確檢查字段對象以確保我不再收到此「無效的定製字段名稱」?
代碼:
Set field = custFields.Field("TEST", "TS_USER_88") <-- crashes here
label = field.UserLabel
If label = Null Then
Print "[" & Sysdate() & "] Project can NOT be migrated..."
Print "[" & Sysdate() & "] FIELD TS_USER_88 NOT FOUND - PROJECT IS NOT SUPPORTED."
Else
...
End If
錯誤:
xy.vbs(126, 7) (null): Invalid customization field name