天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 900|回复: 2

[已解决] sp8 待办摘要中 getname 有误

 关闭 [复制链接]
西北有色 发表于 2014-4-20 20:38:08 | 显示全部楼层 |阅读模式
本帖最后由 nice 于 2014-6-12 16:55 编辑

我的待办摘要中获取作者名称  getname出错,不知道是什么原因。

代码如下

/*****************
var authorname  = getWebUser().getName();
var starttime = getCurDate("yyyy-MM-dd  HH:mm:ss");
var doc = getCurrentDocument();
var author =doc.getAuthor().getName();
var rtn="";
rtn=authorname+"于"+ starttime + "向您提交了《"+author+"的订货申请单》,请办理!";
rtn;

********************/

报错为   TypeError   cannot  call  method "getName"  of  null
nice 发表于 2014-6-11 09:25:39 | 显示全部楼层
本帖最后由 Jarod 于 2014-6-11 18:41 编辑

getWebUser()没有取回值(为null)需要添加判断避免这给我问题。如:

var author = doc.getAuthor();
if (author != null) {
var name = author.getName();

。。。。。。。。
}

。。。。。。。
 楼主| 西北有色 发表于 2014-6-12 16:50:19 | 显示全部楼层
问题已经解决了。

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-13 16:20

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表