Hey all! Quick question. I’m trying to attach item...
# suitescript
j
Hey all! Quick question. I’m trying to attach item records to a support case. I’ve created a custom sublist and I can attach through the UI, but using a UE afterSubmit script, its not allowing: ‘Attaching of record type inventoryitem to supportcase is not supported’. Anyone know a work around for this? Is there a different
type
I should set in the
record.attach()
? In this instance
type
will always be
'inventoryitem'
Current code:
util.each(itemArray, function(item){
var itemId = item.id,
itemType = item.type;
record.attach({
record: {
id: itemId,
type: itemType
},
to: {
id: returnCaseRecordId,
type: record.Type.SUPPORT_CASE
}
});
});
As always thanks in advance for any help
n
@Josh P record.Type.INVENTORY_ITEM from help for record.attach "The record type of the record to attach to. Set the value using the record.Type enum. To attach a file from the File Cabinet to a record, set type to 
file
."
j
@NElliott Thanks for getting back to me. I tried that, it throws the same error.
b
this sounds strange
are you using a field with the
Record is Parent
checkbox marked?
j
@battk no the field isn’t set to
Record is Parent
b
do you have an attach button?
j
Yes
b
im not sure how you get that custom sublist without that
Record is Parent
checkbox being marked on a custom field