首页 > 解决方案 > 通过脚本跟踪收到的电子邮件

问题描述

我有一个用户事件脚本,当从案例记录发送新邮件时,它会将案例记录状态更改为“等待信息”。但是当有人回复该邮件时,我希望脚本再次将状态更改为“已接收”。用户可以从 gmail 或 Outlook 回复。

如何跟踪从 netsuite 外部收到的邮件。

var loadCase = record.load({
            type: nRecType,
            id: recordid
        })
        if(context.type == context.UserEventType.CREATE || context.UserEventType.EDIT)
        {
                var messagenew = objRecord.getValue('messagenew');
                if(messagenew == true)
                {
                    var question = objRecord.getValue('incomingmessage');
                    log.debug('N','question : '+question);
                    if(question == '' || question == null)
                    {}
                    else
                    {
                        loadCase.setValue({
                            fieldId: 'status',
                            value: 8 //waiting for info
                        })
                    }
                }                                                  
                loadCase.save();                                                
        }
}return {
        afterSubmit: afterSubmit
    };

标签: netsuite

解决方案


在 NS 中,当客户回复从案例发送的电子邮件时,NS 将重新打开案例,状态为:Re-Opened [open stage]。您只需将“等待信息”状态设置为一个阶段。您甚至可以将“重新打开”重命名为“已接收”。对于“跟踪从外部收到的邮件”,可能需要一个脚本。这取决于您要如何跟踪它们。


推荐阅读