2016-11-21 151 views
0

在netsuite中,我們在記錄中有「通信」選項卡。就像我在「供應商條例草案」中的記錄一樣。在'通信'選項卡下,我們有'文件'子選項卡,用戶可以在其中上載與該記錄相關的文件。在Netsuite無法通過suitscript訪問「通信」選項卡下的文件

我想用suitscript訪問'文件'選項卡,但它不可見。我已經使用nlapiLoadRecord加載供應商賬單的記錄並檢查記錄,但通信選項卡不存在。

從哪裏可以訪問這些文件或netsuite不提供支持?

回答

3

文件無法通過交易上的子列表獲得。增強請求#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()可以加載它們。

+0

這就是我想要的:) –

相關問題