【发布时间】:2016-03-03 15:37:45
【问题描述】:
我正在处理三个字段:呼叫者、受影响的用户和办公室位置。只是构建这个小脚本来扩展。如果你不知道的话,这里是新手。我们的组织现在刚刚开始服务。刚刚完成管理员培训。
当调用者更改时,它也会使用用户名填充“受影响的用户”字段。 (我们有很多人为其他人制造事件。)
效果很好。但是,当它更改受用户影响时,Office 位置应该填充该位置,但它只填充“未定义”
但是当我自己更改“受影响的用户”字段时,它可以正常工作。
我的脚本改变了一些东西和我改变了一些东西之间有区别吗?这是脚本。
function onChange(control, oldValue, newValue, isLoading) { if (isLoading) return;
if (newValue == '') { g_form.setValue('u_office_location', ''); return; }
if (!g_form.getControl('u_office_location')) return;
var u_user_affected = g_form.getReference('u_user_affected', setLocation); }
function setLocation(u_user_affected) { if (u_user_affected) g_form.setValue('u_office_location', u_user_affected.u_office_location); }
这是从调用者填充用户影响的脚本
function onChange(control, oldValue, newValue, isLoading) { if (isLoading) return;
if (newValue == '') { g_form.setValue('u_user_affected', ''); return; }
if (!g_form.getControl('u_user_affected')) return;
var caller = g_form.getReference('caller_id', setLocation); }
function setLocation(caller) { if (caller) g_form.setValue('u_user_affected', caller.name); }
【问题讨论】:
-
我不知道你的问题的答案,但我知道你很可能会在这里得到更快的回复:community.servicenow.com/welcome
-
谢谢你我会继续。我们是新来这里服务的,所以试图了解他们的资源是如何工作的。
标签: servicenow