i am tring to attach a label on a before submit ``...
# suitescript
s
i am tring to attach a label on a before submit
Copy code
var id = record.attach({
													record: {
														type: 'file',
														id: fileId
													},
													to: {
														type: 'itemfulfillment',
														id: rec.id
													}
												})
b
If you want this to work for the create type, then move it to afterSubmit
s
then I am submitting twice once to save the record and 2nd to "update" attaching
b
You cant attach a file to a record that doesnt exist yet
s
true
is record.submitfields and record.attach going to be to seprate calls ?
b
Yes
s
can they be combined as one? ( because now I'm submitting 3 times)
b
No