SuiteScript 脚本发送语句
SuiteScript Script sending statements
我无法在文档或此处找到此问题的答案。是否可以编写向客户发送报表的脚本?谢谢你提供的所有帮助。
是的,但使用工作流更容易做到这一点。我们为 'Statement Contact' 创建了一个自定义字段,并根据 'Saved Search Filter' 设置了一个预定的工作流程,主要检查客户是否有余额。有一个状态包含一个 'Send Email' 动作。 'Send Email' 操作具有 'Include Statement' 的选项。它在每个月的第 4 天触发 - 您可以将此参数或任何其他参数设置为适合您的任何参数。这对我们来说很好,所以我希望它能帮助你。
我在 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.
}
我无法在文档或此处找到此问题的答案。是否可以编写向客户发送报表的脚本?谢谢你提供的所有帮助。
是的,但使用工作流更容易做到这一点。我们为 'Statement Contact' 创建了一个自定义字段,并根据 'Saved Search Filter' 设置了一个预定的工作流程,主要检查客户是否有余额。有一个状态包含一个 'Send Email' 动作。 'Send Email' 操作具有 'Include Statement' 的选项。它在每个月的第 4 天触发 - 您可以将此参数或任何其他参数设置为适合您的任何参数。这对我们来说很好,所以我希望它能帮助你。
我在 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.
}