ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
支払請求書でスクリプトを介して、PDFに印刷する
適用
製品: NetSuite 2023.1
シナリオ
支払請求書からPDFを生成する方法は以下です。
解決策
1. ユーザーイベントスクリプトのロード前機能に以下のコードを追加します。
function beforeLoad(type, form, request){
if (type == 'edit' || type == 'view'){
var printBtn = form.addButton('custpage_printVB', 'Print Vendor Bill', 'printVB()');
form.setScript('script ID of UE');
}
}
//Suiteletを呼び出す関数
function printVB(){
var suiteletURL = nlapiResolveURL('SUITELET', 'scriptID of suitelet', 'deploymentID of suitelet')+'&custparam_vbid='+nlapiGetRecordId()+'&custparam_rectype='+nlapiGetRecordType();
document.location=suiteletURL;
}
2. Suiteletにて、XML経由でPDFの内容を表示します。「nlapiLoadRecord」を介して支払請求書をリードして、PDFファイルに追加する内容を取得します。サブリストアイテムにループすることも含めます。
function printVBSample(request, response){
var vbid = request.getParameter('custparam_vbid');
var rectype = request.getParameter('custparam_rectype');
var vbRec = nlapiLoadRecord('vendorbill', vbid)
if(vbid){
//ラインアイテムの数を取得する
var lineCount = vbRec.getLineItemCount('item');
//ラインアイテムを表示するテーブルを作成する
var strName = "\"400\">";
strName +="";
strName +="";
strName +="";
strName +="";
strName +="";
strName +="";//アイテム毎にループするfor(var x =1; x <= lineCount; x++){
タグ付けされた:
0