View Single Post
  #8  
Old 25th February 2008, 09:16
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 440
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Rafal,

I agree with you, this is apparantly caused by the field dependancies. When entering a new position the discounts are reset to default. I haven't tried it by this may work: Try opening the position after insert to change the discounts.

Code:
     dal.new.object("tdsls401")
     dal.new.object("tdsls401")
     dal.set.field("tdsls401.orno", orno)
     dal.set.field("tdsls401.item", item)
     dal.set.field("tdsls401.qoor", qoor)
     dal.set.field("tdsls401.pric", tdisa001.pris)
     ret = dal.save.object("tdsls401")
     if ret = 0 then
            select  *
            from    tdsls401 for update
            where  orno = :tdsls401.orno
            and     pono = :tdsls401.pono
            and     seqn = :tdsls401.seqn
            selectdo
                     dal.change.object("tdsls401")
                     dal.set.field("tdsls401.disc", disc, 1)
                     ...
                     ret = dal.save.object("tdsls401")
            endselect
            
            commit.transaction()
     else
            abort.transaction()
            dal.show.errormessages()
     endif
__________________
May the force be with you!
Reply With Quote