amalnat
20th September 2006, 21:20
I am creating a session to link Credit Note with the Original Invoice and process automatically. I am using the Application function server.
I was able to Create a Batch (tfgld1100m000),
Insert a Transaction Type of sales correction (tfgld1101m000),
Select the credit notes (tfacr2120s000),
Select the original invoices (tfacr2121s000)
When doing a (stpapi.continue.process) continue process on tfacr2121s000, it calls another session (tfcmg2114s000) to accept series for Document number. Even after assigning the proper values to this session, linking process does not work correctly.
Any help is appreciated
mark_h
20th September 2006, 22:38
This is the correct forum for AFS posts.
You might want to post the relevant code around the continue in tfacr2121s000 and tfcmg2114s000. I am not familiar with these sessions or this process, but maybe something in the code will stick out.
I also recommend reading my mantra down below.
steveauckly
20th February 2015, 18:09
Can you please post your code for how you handle tfacr2120s000? It is one of the sessions that starts with a "Find" popup and I can't seem to get past it.
bhushanchanda
22nd February 2015, 05:18
Hi,
Check this thread (http://aridhol.kudos.be/baanboard/showthread.php?t=64561) Might give you some clues.
And again, unless you do not put your code in here, its difficult to understand the exact issue you are facing.
And here is one more - Thread 2 (http://www.baanboard.com/baanboard/showthread.php?t=14084)
steveauckly
23rd February 2015, 14:30
Here is the code giving me problems. tfacr2120s000 starts with the "Find" popup, I try filling in the fields and doing a continue or find, but it isn't finding the correct record.
if this.invn > 0 then
stpapi.handle.subproc("tfgld1101m000","tfacr2120s000", "add")
stpapi.continue.process("tfgld1101m000",g.err.msg)
stpapi.put.field("tfacr2120s000","tfacr200.cuno",tfacr200.cuno)
stpapi.put.field("tfacr2120s000","tfacr200.ttyp",tfacr200.refr(1;3))
stpapi.put.field("tfacr2120s000","tfacr200.ninv",str$(this.invn))
ret = stpapi.browse.set("tfacr2120s000","find.data",g.err.msg)
if ret then
ret = stpapi.mark("tfacr2120s000",g.err.msg)
stpapi.handle.subproc("tfacr2120s000","tfacr2121s000", "add")
stpapi.continue.process("tfacr2120s000",g.err.msg)
stpapi.put.field("tfacr2121s000","tfacr200.cuno",tfacr200.cuno)
stpapi.put.field("tfacr2121s000","tfacr200.ttyp",tfacr200.ttyp)
stpapi.put.field("tfacr2121s000","tfacr200.ninv",str$(tfacr200.ninv))
ret = stpapi.browse.set("tfacr2121s000","find.data",g.err.msg)
if ret then
stpapi.put.field("tfacr2121s000","tfacr200.lamt",str$(tfacr200.amnt))
ret = stpapi.update("tfacr2121s000", true, g.err.msg)
ret = stpapi.mark("tfacr2121s000",g.err.msg)
stpapi.handle.subproc("tfacr2121s000","tfcmg2114s000", "add")
stpapi.continue.process("tfacr2121s000",g.err.msg)
stpapi.put.field("tfcmg2114s000", "main.docn", "0")
ret = stpapi.update("tfcmg2114s000", true, g.err.msg)
if ret = 0 or ret = 1 then
g.err.msg="."
while not isspace(g.err.msg)
this.str = stpapi.get.mess.code("tfcmg2114s000", g.err.msg)
if isspace(g.err.msg) or g.err.msg = "." then
break
endif
endwhile
stpapi.continue.process("tfcmg2114s000",g.err.msg)
endif
stpapi.end.session("tfcmg2114s000",g.err.msg)
endif
stpapi.end.session("tfacr2121s000",g.err.msg)
endif
stpapi.end.session("tfacr2120s000",g.err.msg)
endif
mark_h
23rd February 2015, 16:54
Working with this part of the code
stpapi.handle.subproc("tfgld1101m000","tfacr2120s000", "add")
stpapi.continue.process("tfgld1101m000",g.err.msg)
stpapi.put.field("tfacr2120s000","tfacr200.cuno",tfacr200.cuno)
stpapi.put.field("tfacr2120s000","tfacr200.ttyp",tfacr200.refr(1;3))
stpapi.put.field("tfacr2120s000","tfacr200.ninv",str$(this.invn))
ret = stpapi.browse.set("tfacr2120s000","find.data",g.err.msg)
Have you tried change.view instead of browse.set? Or better yet - have you tried a straight out stpapi.find?
steveauckly
24th February 2015, 14:59
Thanks Mark! My code above is one of many things I tried, but I hadn't tried change.view.:D