Netsuite SuiteScript脚本发送语句

Netsuite SuiteScript脚本发送语句,netsuite,suitescript,Netsuite,Suitescript,我在文档或这里找不到这个问题的答案。是否可以编写向客户发送报表的脚本?谢谢你能给我的帮助 是的,但是使用工作流更容易做到这一点。我们为“声明联系人”创建了一个自定义字段,并根据“保存的搜索筛选器”设置了一个计划工作流,该筛选器基本上检查客户是否有余额。有一个状态包含一个“发送电子邮件”操作。“发送电子邮件”操作具有“包含声明”选项。它在每个月的第4天启动-您可以将此参数或任何其他参数设置为适合您的任何参数。这对我们来说很好,所以我希望它能帮助您。是的,但使用工作流更容易做到这一点。我们为“声明联

我在文档或这里找不到这个问题的答案。是否可以编写向客户发送报表的脚本?谢谢你能给我的帮助

是的,但是使用工作流更容易做到这一点。我们为“声明联系人”创建了一个自定义字段,并根据“保存的搜索筛选器”设置了一个计划工作流,该筛选器基本上检查客户是否有余额。有一个状态包含一个“发送电子邮件”操作。“发送电子邮件”操作具有“包含声明”选项。它在每个月的第4天启动-您可以将此参数或任何其他参数设置为适合您的任何参数。这对我们来说很好,所以我希望它能帮助您。

是的,但使用工作流更容易做到这一点。我们为“声明联系人”创建了一个自定义字段,并根据“保存的搜索筛选器”设置了一个计划工作流,该筛选器基本上检查客户是否有余额。有一个状态包含一个“发送电子邮件”操作。“发送电子邮件”操作具有“包含声明”选项。它在每个月的第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.
}

我在西装中发现了这个答案,这就足够了

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.
}