ディスカッション
NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Keep an eye out for upcoming NetSuite events, including meetups, workshops, and webinars. These sessions are a great way to connect with peers, learn from experts, and stay current on the latest NetSuite updates and best practices. Registration links are provided in each event.
NetSuite管理者ヒント| SuiteScriptを使用した顧客の無効の検出とステータスの変更
顧客データベースを最新の状態に保つことは、正確な記録を維持し、効率的な事業運営をサポートするために不可欠です。時間の経過とともに、一部の顧客は無効になったり、注文しなくなったり、会社と関わり合ったりすることがあります。各レコードを手動で確認するかわりに、定期スクリプトを使用してこのプロセスを自動化できます。
このスクリプトでは、N/searchおよびN/recordモジュールを使用して、過去1年以内に注文書を作成していない顧客を識別し、ステータスを自動的に無効に更新します。この自動化を実装することで、管理者は時間を節約し、手作業を削減し、顧客データをクリーンで最新の状態に保つことができます。
サンプル定期スクリプトコード
/**
* @NApiVersion 2 .x
* @NScriptType ScheduledScript
*/
define(['N/search', 'N/record', 'N/log'], function(search, record, log) {
function execute(context) {
try {
// Search for customers who haven't created a sales order in the last 365 days
var customerSearch = search.create({
type: search.Type.CUSTOMER,
filters: [
["lastorderdate","onorbefore","daysago365"]
],
columns: ["entityid", "internalid"]
});
customerSearch.run().each(function(result) {
var customerId = result.getValue("internalid");
// Load customer record
var customer = record.load({
type: record.Type.CUSTOMER,
id: customerId,
isDynamic: false
});
// Set status to inactive (adjust fieldId as per your setup)
customer.setValue({
fieldId: 'entitystatus', // May vary based on your configuration
value: 14 // Replace with appropriate status internal ID Richard James Uri - SuiteCloud | WMS Tech | SuiteCommerce Advanced
----
- NetSuite Admin Corner | New to NetSuite
- Explore the NSC Webinars Category
- Join our poll and share your ideas! We want to know what you think. Don't forget to comment and make your voice heard!
- Expand your NetSuite knowledge by joining this month's Ask A Guru Live: PROCURE TO PAY. RSVP on this event now!
タグ付けされた:
0
