i am in invoice group record and i want to attach ...
# suitescript
r
i am in invoice group record and i want to attach a file in the files sublist how do i get the sublist id? i tried scripted record and xml but got nothing?
n
In ns help search record.attach(options) @razer456
r
yes gotcha, thanks!
record.type for invoice group is not available is there a work around? @NElliott
n
have you tried setting it to "invoicegroup"
Copy code
var id = record.attach({
    record: {
        type: 'file',
        id: '200'
    },
    to: {
        type: 'invoicegroup',
        id: '90'
    }
});
like that
r
{"type":"error.SuiteScriptError","name":"SSS_INVALID_ATTACH_RECORD_TYPE","message":"Attaching of record type file to invoicegroup is not supported.","stack":["Error\n at Object.attachRecord (suitescript/resources/javascript/record/recordImpl.js16911)\n at Object.convertAttachandLoad (/SuiteScripts/BFL_Suitelet_Attachfile.js6837)"],"cause":{"type":"internal error","code":"SSS_INVALID_ATTACH_RECORD_TYPE",
i did
is there no other way ?
n
I don't know of another way, btw looking at the records browser this record has no sublists. I'm not familiar with invoice groups either I'm afraid.