Customer のオンボーディング workflow を準備する際、成長中の流通企業の管理者は、saved searches、workflows、およびインテグレーションを構築する前に、どの Customer フィールドに使用可能なデータが格納されているかを確認する必要がありました。たとえば、Customer Status フィールドには内部 ID が格納されている一方、ユーザーには読みやすいステータス名が表示されていました。
Script サンプル
この scheduled script は、フィールド・タイプ、格納されている値、および該当する場合は表示テキストをすばやく確認し、管理者が自動化を正しく構成できるようにします。
/**
* @NApiVersion 2 .1
* @NScriptType ScheduledScript
*/
define(['N/record', 'N/log'], (record, log) => {
const execute = () => {
// Load a Customer record.
const customer = record.load({
type: record.Type.CUSTOMER,
id: 123 // Replace with a valid Customer internal ID
});
// Customer fields to inspect.
const fieldIds = [
'companyname',
'email',
'entitystatus',