[英]In Netsuite not able to access the file under 'Communication' tab through suitscript
在netsuite中,記錄中有“通信”選項卡。 就像我的案例中的“供應商條例草案”記錄一樣。 在“通訊”標簽下,我們有“文件”子標簽,用戶可以在其中上傳與該記錄相關的文件。
我想用腳本訪問該“文件”選項卡,但它不可見。 我已經使用nlapiLoadRecord加載了供應商賬單的記錄並檢查了該記錄,但是通訊選項卡不存在。
從哪里可以訪問這些文件,或者netsuite不提供對此的支持?
文件不能通過事務子列表獲得。 已打開增強請求#187429來解決此問題。 同時,您可以通過以下搜索來訪問附加到給定記錄的文件:
function getAttachedFileIds(recordType, recordId) {
var fileIds = nlapiSearchRecord(recordType, null, [
new nlobjSearchFilter('internalid', null, 'anyof', recordId),
new nlobjSearchFilter('mainline', null, 'is', 'T')
], [
new nlobjSearchColumn('internalid', 'file'),
new nlobjSearchColumn('name', 'file')
]);
return (fileIds || []).map(function(file) {
return {
id: file.getValue('internalid', 'file'),
name: file.getValue('name', 'file')
}
});
}
var fileIds = getAttachedFileIds('expensereport', 3408401);
獲取文件ID列表后,可以根據需要使用nlapiLoadFile()
加載它們。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.