在 NetSuite SuiteCommerce Advanced 中,我试图获取当前登录的用户头衔(先生、夫人等)。
我正在使用Commerce APIand 函数Customer::getFieldValues()。我正在检索列/字段名称salutation。当我执行此函数时,它应返回用户标题/称呼时返回一个空对象。注意:我已经确认用户的头衔/称呼设置为 'Mr'。
为什么 SCA 不返回用户的标题有什么建议?这对NS来说太烦人了!
*Modules\MyOverrides\ProfileOverrides@1.0.0\SuiteScript\Profile.Model.js :
define('Profile.Model',['SC.Model', 'underscore', 'Utils'], function (SCModel, _, Utils)
{
'use strict';
return SCModel.extend({
name: 'Profile'
, get: function ()
{
//You can get the profile information only if you are logged in.
if (this.isLoggedIn && this.isSecure)
{
// Retrieve the currently logged in users saluation (eg Sir, Mr, Mrs, etc.)
// Why on earth does NS not return this!!!
var profile = customer.getFieldValues(['salutation']);
console.log("PROFILE", profile); // outputs "PROFILE {}"
...
*编辑:我错误地指出文件是
Modules\MyOverrides\AccountOverrides@1.0.0\SuiteScript\Account.Model.js:实际上是Modules\MyOverrides\ProfileOverrides@1.0.0\SuiteScript\Profile.Model.js。