获取当前用户的账户类型、域id
Get Current user's account type, domain id
如何获取当前用户的账户类型,是Production还是Sandbox,还有domain id。
我尝试使用
var output = url.resolveDomain({
hostType: url.HostType.APPLICATION
})
但它抛出 TypeError Cannot read 属性 'APPLICATION' of undefined
您可以使用 N/runtime
模块获取此信息:
var accountId = runtime.accountId;
var environment = runtime.envType; // PRODUCTION, SANDBOX, etc.
如何获取当前用户的账户类型,是Production还是Sandbox,还有domain id。
我尝试使用
var output = url.resolveDomain({
hostType: url.HostType.APPLICATION
})
但它抛出 TypeError Cannot read 属性 'APPLICATION' of undefined
您可以使用 N/runtime
模块获取此信息:
var accountId = runtime.accountId;
var environment = runtime.envType; // PRODUCTION, SANDBOX, etc.