The only optiojn is to programmatically set the limit, launch the script workflow editor, and add the following code as the first line under the Defect Module:
**'---Limit Attachment Size
Dim MaxFileSize 'Global Variable to hold max file size
MaxFileSize = 6000 'Set the maximum attachment size in Bytes
Dim Bugid 'Global Variable to hold Requirement ID*****
Then you'll need to create a subroutine (Just add this code to the bottom of the Defect module if there are other subroutines:
Sub Defects_Attachment_New(Attachment)
On Error Resume Next
if Attachment.Type = 1 then 'Attachement is of type TDATT_FILE - a file.
if Attachment.FileSize > MaxFileSize then
Dim tdc
Dim BugF, AttF
Dim Cmd, rs
Dim Text
Dim bug, attid
set tdc=TDConnection
set BugF = tdc.BugFactory ' this section gets the list of Attachments
set bug = BugF.Item(Bugid) ' for the current Defect.
set AttF = bug.attachments
Text = ''SELECT * FROM CROS_REF WHERE CR_REFERENCE = '''&Attachment.name&'''''
set cmd = tdc.Command 'Create an SQL Command object
Cmd.CommandText = Text
set rs = Cmd.Execute 'Create a recordset of the current attachment
if rs.RecordCount > 0 then 'Ensure that the command returned a result
rs.first 'Get to the start of the recordset
attid = rs.FieldValue(2) 'Get the ID of the attachment (field 2 = CR_REF_ID)
AttF.RemoveItem(attid) 'Remove the Attachment from the Factory
MsgBox ''This Attachment is too large. You can only upload files smaller than ''&MaxFileSize&'' Bytes''
MsgBox ''The attachment has not been uploaded.''
else
msgbox ''An error has occured. Please try again.''
end if
end if
end If
On Error GoTo 0
End Sub
Lastly, we need to add the following code to the Bug_MoveTo subroutine:
Sub Bug_MoveTo
Fields = Bug_Fields
Bugid = Fields(''BG_BUG_ID'').Value 'Set the global variable holding entity's id
msgbox(''Bugid = ''& Bugid)
End Sub