2017-04-18 15 views

答えて

0

私はこれをSuiteAnswersで見つけましたが、それは私の目的にとっては十分です。

function printStatement() 
{ 
//this is is the customer id 
var id = nlapiGetRecordId(); 
var email = nlapiGetFieldValue('custentity_accounting_email');    
//create an array to set the STATEMENT properties(optional) 
var sdate = new Array(); 
sdate.startdate = '11/01/2015'; // replace it as per requirement 
sdate.statementdate = '11/30/2015'; // replace it as per requirement 
sdate.openonly = 'T'; // replace it as per requirement 
sdate.formnuber = 112; // replace it as per requirement 

//print the statement to a PDF file object 
var file = nlapiPrintRecord('STATEMENT', id, 'PDF', sdate); 

//send the PDF as an attachment 
nlapiSendEmail('-5', email, 'Regular Statement', 'Please see attached  Statment', null, null, null, file); //change the value of author id. 
} 
2

はい、それでも、ワークフローでそれを行う方が簡単です。私たちは 'Statement Contact'のカスタムフィールドを作成し、基本的に顧客がバランスを取っているかどうかをチェックする 'Saved Search Filter'に基づいてスケジュールされたワークフローを設定しました。 1つの[Send Email]アクションが含まれている状態が1つあります。 [電子メールの送信]アクションには、[ステートメントを含める]オプションがあります。毎月4日に発射されます。このパラメータやその他のパラメータは、あなたに合ったものに設定できます。これは私たちのためにうまくいくので、私はそれがあなたを助けることを願っています

関連する問題