Netsuite:服务器端代码没有为csv上传启动?

时间:2015-09-24 14:23:11

标签: netsuite

我创建了一个脚本并将其部署为在我们的系统中创建新的库存项目时自动填充Web商店字段。

当通过界面创建新项目时,代码有效,但是当通过csv上传新项目时,代码不起作用。

这是代码:

    while (listPermsEnumerator.moveNext()) {
        enumG = groups.getEnumerator();
        var rAssignment = listPermsEnumerator.get_current();
        var member = rAssignment.get_member();
        var groupCounter = 1;
        var name = '';

        //alert(''); This alert makes code work

        while (enumG.moveNext()) {
            var group = enumG.get_current();
            var groupname = group.get_title();
            //alert(groupname);
            if (member.get_title() === groupname) {
                name = groupname;
                SP.SOD.executeOrDelayUntilScriptLoaded(function(){
                    retrieveAllUsersInGroup(groupname, groupCounter, groups);
                }, key);
            }
            groupCounter++;
        }

        roleAssignment = this.listRoleAssignments.getByPrincipalId(member.get_id());
        roleBindings = roleAssignment.get_roleDefinitionBindings();
        // in checkPermission() another executeQqueryAsync is called
        checkPermission(context, roleAssignment, roleBindings, name);
    }

    ...
    function checkPermission(context, roleAssignment, roleBindings, name) {
        this.name = name;
        context.load(roleAssignment);
        context.load(roleBindings);
        context.executeQueryAsync(Function.createDelegate(this, Bind), Function.createDelegate(this, BindFail));
    }

}

然后将此函数称为“提交后函数”。我是不是在正确的地方打电话来运行csv上传?

这是我的脚本部署: enter image description here

1 个答案:

答案 0 :(得分:4)

  1. 转到"设置>导入/导出> CSV导入首选项"
  2. 确保"运行服务器SUITESCRIPT和TRIGGER WORKFLOWS"检查。