用友软件加载单据模版错误

技术咨询,有偿服务!
复制微信号
原因分析:原先产成品入库单有多个自定义显示模版,并使用过自定义模版做产成品入库单。后期又删除这些自定义模版,当再次打开单据列表已删除模版的入库单时导致系统加载不到对应自定义的单据模版。
问题解答:上述问题在日常维护中经常出现,下面是一般的解决思路:首先,需要确定错误单据的单据类型编号,对应的记录表为vouchtype,如下面脚本:select * from vouchtype (如:产成品入库单对应单据类型编号cvouchtype为10);然后,需要查询出单据中有哪些模版号不存在于单据模版表中,如上述中产成品入库单对应单据编号为10,查询rdrecord表中有哪些模版号不存在于单据模版表VoucherTemplates中的脚本如下:select distinct(rd.vt_id) as 丢失的模版号 from rdrecord rd left join VoucherTemplates vt on rd.vt_id=vt.VT_ID where vt.VT_ID is null and cVouchType=10; 要确定单据中的模版号在模版表中存在的脚本:select distinct(rd.vt_id) as 正确的模版号 from rdrecord rd left join VoucherTemplates vt on rd.vt_id=vt.VT_ID where vt.VT_ID is not null and cVouchType=10最后,可统一对丢失模版号的单据重新赋值即可,如下面脚本是将丢失的模版号的单据重新赋予正确的模版号:update rdrecord set VT_ID=63 where vt_id in(select distinct(rd.vt_id) as 丢失的模版号 from rdrecord rd left join VoucherTemplates vt on rd.vt_id=vt.VT_ID where cVouchType=10 and vt.VT_ID is null)