TER trigger update_fbillno
on ICStockBillEntry
for update,insert
as
if UPDATE(fitemid)
update t3 set t3.FEntrySelfB0170=t2.fbillno,t3.FEntrySelfB0169=t2.FDate from
inserted t1 inner join
ICStockBill t2 on t1.FInterID=t2.FInterID
inner join ICStockBillEntry t3 on t1.FInterID=t3.FInterID
where t2.FTranType='21'
ICStockBillEntry是单据的表体,ICStockBill 是单据的表头,单据的表头是先创建的,表体的后创建的,我是希望在表体中的两个字段在保存的时候,分别取得表头上的单据号和日期。可是在正常录入单据的情况下,我却得不到这一结果。而如果是复制的单据就可以得到,大师们请指教!谢谢
on ICStockBillEntry
for update,insert
as
if UPDATE(fitemid)
update t3 set t3.FEntrySelfB0170=t2.fbillno,t3.FEntrySelfB0169=t2.FDate from
inserted t1 inner join
ICStockBill t2 on t1.FInterID=t2.FInterID
inner join ICStockBillEntry t3 on t1.FInterID=t3.FInterID
where t2.FTranType='21'
ICStockBillEntry是单据的表体,ICStockBill 是单据的表头,单据的表头是先创建的,表体的后创建的,我是希望在表体中的两个字段在保存的时候,分别取得表头上的单据号和日期。可是在正常录入单据的情况下,我却得不到这一结果。而如果是复制的单据就可以得到,大师们请指教!谢谢