kumarabinash
7th November 2005, 06:24
I was trying AFS for session whinh4525000.
if i go directly to session afs through synchnize dialog and start putting field values then, save button is disabled on form.
same session if i go through whinh2120m000,and open then save button is enabled.
now if i am going through whinh2120m000 then error is Synchronize dialog not started. and if i go directly to whinh4525mooo then error that i get is command disabled(when i try to insert or save).

kindly have a look at the code and advice me accordingly.

whinh2120m000f.put.Order.whinh220.oorg( whinh220.oorg )
whinh2120m000f.put.Order.whinh220.orno( whinh220.orno )
whinh2120m000f.put.Set( whinh220.oset )
whinh2120m000f.put.Order_Line( whinh220.pono )
whinh2120m000f.put.Sequence( whinh220.seqn )

whinh2120m000f.find( msg.error1 )
if isspace(msg.error1) then
whinh2120m000f.mark( msg.error1 )
if isspace(msg.error1) then
whinh2120m000f.Outbound_Advice( msg.error1 )
| whinh4525m000f.synchronize.dialog( "add", msg.error1)
if isspace(msg.error1) then
whinh4525m000f.put.Lot( tdsls951.labl )
whinh4525m000f.put.Effectivity_Unit( whinh220.effn )
temp.btno = "3PL "
whinh4525m000f.put.Run( temp.btno )
whinh4525m000f.insert( do.update, msg.error1 ) |this is where error is encountered as button disabledif synchrnization dialog is declared
if isspace(msg.error1) then
whinh4525m000f.save( msg.error1 )
if isspace(msg.error1) then
whinh4525m000f.mark(msg.error1)
if isspace(msg.error1) then
whinh4525m000f.handle.sub.process( "whinh4202m000","add" )
whinh4525m000f.Releasewhinh4202m000( msg.error1 )
if isspace(msg.error1) then
temp.btno = "3PL "
whinh4202m000f.put.Run( temp.btno )
whinh4202m000f.set.report( "rwhinh420011000", "D", msg.error1 )
whinh4202m000f.Release_Advice( msg.error1 )
if not isspace(msg.error1) then
whinh4202m000f.Undo_Release( msg.error1 )
session.name = "whinh4202m000-Release Outbound-While Releasing"
write.file()
else
whinh4525m000f.handle.sub.process( "whinh4202m000","kill" )
whinh4525m000f.end()
whinh2120m000f.handle.sub.process( "whinh4525m000","kill" )
endif
else
whinh4525m000f.handle.sub.process( "whinh4202m000","kill" )
session.name = "whinh4202m000-Release Outbound-Session Could not Open"
write.file()
endif
else
whinh4525m000f.end()
whinh2120m000f.handle.sub.process( "whinh4525m000","kill" )
session.name = "whinh4525m000-Maintain Outbound-Record Not Marked After Save"
write.file()
endif
endif
endif
else
whinh4525m000f.end()
whinh2120m000f.handle.sub.process( "whinh4525m000","kill")
write.file()
endif
endif
else
whinh2120m000f.end()
session.name = "whinh2120m000-Outbound Order Lines-Record Not Found"
write.file()
endif
whinh2120m000f.end()

mark_h
8th November 2005, 15:29
See if this thread (http://www.baanboard.com/baanboard/showthread.php?t=24447&highlight=synchronize+dialog+started) or this thread (http://www.baanboard.com/baanboard/showthread.php?t=9562&highlight=synchronize) helps. Always make sure all objects are current. Since I am not familiar with LN I will not be any help.

kumarabinash
9th November 2005, 07:01
Thanks for reply.
i referred all these threads and changed code accordingly,by trying synchronize,synchronize.set commands,but problem could not be solved beacuse the session whinh4525m000 gets open with various forms depending up on the calling program.if we go directly to session whinh4525m000,then save button and new/insert button is disabled on synchonized from.in AFS i could not find any command for save and exit.may be i am missing something in the code.
as i found out from thread ,it could also be a problem with tools / patch ,i have logged a case in baan and waiting for there response.
in the mean time i am trying dal.new/db.insert function.to solve the purpose.

rberti
9th April 2007, 21:17
Hi all, I've used a simple AFS. I had only a few problems with data consistency, but in the end worked fine.


function extern tiaundllo002.gerar.e.liberar.aviso.de.saida(
domain whinh.oorg oorg.o,
domain tcorno orno.o,
domain tcpono oset.o, |order set
ref domain tcpono pono.o,
domain tcpono seqn.o, |sequencial da linha
domain whloca locf.o,
domain whloca loct.o,
domain tcitem item.o fixed,
domain tccuni cuni.o,
domain tcclot clot.o,
domain whhuid tohu.o,
domain tcinvt.date idat.o,
domain tcqst1 qads.o )

{

domain tcsern sern.o |numero do aviso de saida
domain whinh.btno runn.o
runn.o = ""
stpapi.synchronize.dialog("whinh4525m000", "add" , err_msg)
stpapi.put.field( "whinh4525m000", "whinh225.oorg", str$(oorg.o)) |Tipo de ordem
stpapi.put.field( "whinh4525m000", "whinh225.orno", orno.o) |Ordem
stpapi.put.field( "whinh4525m000", "whinh225.oset", str$(oset.o)) |Set
stpapi.put.field( "whinh4525m000", "whinh225.pono", str$(pono.o)) |numero da linha
stpapi.put.field( "whinh4525m000", "whinh225.seqn", str$(seqn.o)) |squencial
stpapi.put.field( "whinh4525m000", "whinh225.sern", str$(sern.o)) |aviso
stpapi.put.field( "whinh4525m000", "whinh225.locf", locf.o) |local de origem
stpapi.put.field( "whinh4525m000", "whinh225.loct", loct.o) |local de destino
stpapi.put.field( "whinh4525m000", "whinh225.clot", clot.o) |lot
stpapi.put.field( "whinh4525m000", "whinh225.idat", str$(idat.o)) |Data Inventário
stpapi.put.field( "whinh4525m000", "whinh225.tohu", tohu.o) |unidade gestão destino
stpapi.put.field( "whinh4525m000", "whinh225.qads", str$(qads.o)) |quantidade
stpapi.put.field( "whinh4525m000", "whinh225.item", item.o) |item
stpapi.put.field( "whinh4525m000", "whinh225.cuni", cuni.o) |unidade
stpapi.put.field( "whinh4525m000", "whinh225.runn", runn.o) |exec. nº
err = stpapi.insert( "whinh4525m000", 1, err_msg )
|--->>> HERE I'm releasing the outbound advice
err = stpapi.find("whinh4525m000", err_msg)
err = stpapi.mark("whinh4525m000", err_msg)
stpapi.form.command("whinh4525m000", 5, "release.advice", err_msg)
stpapi.end.session( "whinh4525m000", err_msg ) |Fechando a sessão
}



hope it helps.

best regards!

eric.dizon
15th August 2014, 23:25
I am trying to use the same session in AFS whinh4525m000 - but my goal is to find a specific run number, open the records so I can update the lot number it is using and then save and close the dialog that was open. Can anybody give me an example on how to do this.

In multi-occurrence session in AFS how do I ?
1. Use the proper index in order to initiate a find command
2. When the record is located, open the dialog and update the lot number from the session
3. Save and close the update created

Regards,

Eric