View Single Post
  #1  
Old 3rd March 2016, 14:10
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 50
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Handle STD Question

Hello ,

My Requirement is to Insert Label in STD Label Session ttadv1140m000,
so I have Write AFS for that session .It is working for New Label with new desc .but if i have insert new Label for Which desc is already Present in some existing session, it will ask one question in std "ttadv11403" , but that Question is not handle in my AFS .I have Tried Question Code at Diffrent Place but still not working for new DESC

|| AFS

stpapi.put.field("ttadv1140m000", "ttadv140.clan", cust.clan)
stpapi.put.field("ttadv1140m000", "ttadv140.cpac", cust.cpac)
ret = stpapi.change.view("ttadv1140m000", err)

ret = stpapi.synchronize.dialog("ttadv1140m000", "add", err)
if ret = 1 then
stpapi.enum.answer("ttadv1140s000", "ttadv11403", ttyeno.yes )
stpapi.put.field("ttadv1140s000", "ttadv140.vers", cust.vers)
stpapi.put.field("ttadv1140s000", "ttadv140.rele", cust.rele)
stpapi.put.field("ttadv1140s000", "ttadv140.cust", cust.cust)

stpapi.put.field("ttadv1140s000", "ttadv140.zc_cont", str$(etol (ttadv.cont.general)))
stpapi.put.field("ttadv1140s000", "ttadv140.desc", str$(trim$(new.label)))
stpapi.put.field("ttadv1140s000", "ttadv140.clab", trim$(f.prefix & str$(get.count)))
stpapi.enum.answer("ttadv1140s000", "ttadv11403", ttyeno.yes )

ret = stpapi.insert("ttadv1140s000",true, err)
if ret then
stpapi.get.field("ttadv1140s000", "ttadv140.desc", get.desc)
stpapi.get.field("ttadv1140s000", "ttadv140.clab", get.clab)
endif
stpapi.end.session("ttadv1140s000")
stpapi.end.session("ttadv1140m000")
endif

I have Also done this by Using DAL - but it will give language error in DAL - i have use 2 as language

switch.to.company(000)
dal.new.object("ttadv140")
dal.set.field("ttadv140.clan", "2")
dal.set.field("ttadv140.cpac", cust.cpac)
dal.set.field("ttadv140.vers",cust.vers)
dal.set.field("ttadv140.rele",cust.rele)
dal.set.field("ttadv140.cust",cust.cust)
dal.set.field("ttadv140.zc_cont",ttadv.cont.general)
dal.set.field("ttadv140.desc",new.label)
dal.set.field("ttadv140.clab", f.prefix)

if dal.save.object("ttadv140") = 0 then
commit.transaction()
else
dal.get.error.message(err)
mess("ltanystr",0,err)
endif

Thank you
Frenny K
Reply With Quote