Hemant3498
4th November 2014, 13:44
Hi All,
I am trying to insert records in tibd001 session through AFS, but the sub-entity do not get updated.
When I insert a record manually and save the data the sub-entity gets filled from Item defaults.
Please help me on how this can be solved(see code below).
ret = stpapi.synchronize.dialog("tcibd0501m000", "add", error.msg)
if ret then
stpapi.put.field( "tcibd0101s000", "tcibd001.item.segment.1", "")
stpapi.put.field( "tcibd0101s000", "tcibd001.item.segment.2", str$(trim$(item)) )
stpapi.put.field( "tcibd0101s000", "tcibd001.citg", str$(citg))
stpapi.put.field( "tcibd0101s000", "tcibd001.kitm", str$((kitm)))
stpapi.put.field( "tcibd0101s000", "tcibd001.dscb", str$(dscb ))
stpapi.put.field( "tcibd0101s000", "tcibd001.dscc", str$(dscc))
stpapi.put.field( "tcibd0101s000", "tcibd001.cpln", str$(cpln))
stpapi.put.field( "tcibd0101s000", "tcibd001.dsca", str$(dsca ))
stpapi.put.field( "tcibd0101s000", "tcibd001.exin", str$(exin))
stpapi.put.field( "tcibd0101s000", "tcibd001.uset", str$(uset))
stpapi.put.field( "tcibd0101s000", "tcibd001.cuni", str$(cuni))
stpapi.put.field( "tcibd0101s000", "tcibd001.cwun", str$(cwun))
stpapi.put.field( "tcibd0101s000", "tcibd001.wght", str$(wght))
stpapi.insert("tcibd0101s000",true,error.insert)
| ret = stpapi.insert("tcibd0501m000",true,error.insert)
if not ret then
ret = stpapi.recover("tcibd0101s000", error.msg)
endif
stpapi.end.session("tcibd0501m000", error.end)

Thanks.

bhushanchanda
4th November 2014, 14:30
Hi,

What version of Baan are you using? If on LN, try DAL.

mark_h
4th November 2014, 15:55
Bhushan is correct. You can also search thru this forum for the session numbers - this thread http://www.baanboard.com/baanboard/showthread.php?t=15081&highlight=tcibd0501m000 popped up for me.

vinceco252
4th November 2014, 17:41
Agree with Bhushan on DAL. Also, for the subentities to work, you need to make sure all of the item default data for the subentities is filled.

Vince