同意!
设置外键,然后用两个DW字段值传递,大致如下:
int li_i,li_id
string ls_spbm,ls_jcbh
ls_jcbh=dw_1.object.jcbh[1]
select max(id) into :li_id from splist where jcbh=:ls_jcbh;
if isnull(li_id) then li_id=0
for li_i=1 to this.rowcount()
if getitemstatus(li_i,0,primary!)=new! then continue
if getitemstatus(li_i,0,primary!)=newmodified! then
li_id ++
this.object.id[li_i]=li_id
end if
this.object.jcbh[li_i]=dw_1.object.jcbh[1]
this.object.sdrq[li_i]=dw_1.object.sdrq[1]
this.object.gcdm[li_i]=dw_1.object.gcdm[1]
this.object.gcmc[li_i]=dw_1.object.gcmc[1]
this.object.ckdz[li_i]=dw_1.object.ckdz[1]
this.object.ckmc[li_i]=dw_1.object.ckmc[1]
next