User login
|
|
|
Frontpage Sponsor
|
|
|
Poll
|
Would you like to see a separate forum on Baanboard for the ION product? No 14% Yes 86% Total votes: 80 |
Baanboard at LinkedIn
|

|
|
|
 |

12th April 2011, 11:41
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Nottingham
Posts: 483
|
|
|
Baan: Baan IVc4 ags0 -
DB: Informix 9.40 UC4 -
OS: Sun Solaris 9
|
AFS for tfacr4410m000 and Credit Notes
Hello all,
A few months ago I developed an AFS for Sales Invoices which has now been running live for a few months. Finance have now asked me to look at credit notes coming through the AFS as well.
In theory this should be simple enough just use a Credit Notes Transaction Type in our case SCN. However for some reason the AFS is returning an insert error "Series not defined". The series I am using defintely exists and I have proved this manually through the session. The AFS log also agrees with the variables I am putting into the session so I am at a loss to what is happening. Any ideas greatly appreciated. See below for code and AFS log.
Cheers Neal
Quote:
tfacr4100m000(34)-RUNNING:
>tfacr4100m000(34) put.field:tfacr400.ttyp SCN
>tfacr4100m000(34) put.field:tfacr400.ninv 4
>tfacr4100m000(34) put.field:tfacr400.cuno B016
>tfacr4100m000(34) put.field:tfacr400.refr 901579
>tfacr4100m000 insert
11dll->serv (add.set+save34)
tfacr4100m000(34)-RUNNING:add.set+save
34serv<-4gl (add.set+save10)
tfacr4100m000(34)-RUNNING:
<tfacr4100m000 Series not defined
|
Code:
if m_credit = 1 then
m_ttyp1 = "SCN"
else
m_ttyp1 = tdsls910.ttyp
endif
message(m_ttyp1)
message(str$(tdsls910.ninv))
message(tdsls945.cuno)
message(str$(tdsls945.orno))
stpapi.put.field( "tfacr4100m000", "tfacr400.ttyp", m_ttyp1 )
stpapi.put.field( "tfacr4100m000", "tfacr400.ninv", str$(tdsls910.ninv))
stpapi.put.field( "tfacr4100m000", "tfacr400.cuno", tdsls945.cuno)
stpapi.put.field( "tfacr4100m000", "tfacr400.refr", str$(tdsls945.orno))
ret=stpapi.insert( "tfacr4100m000", do.update, error ) |INSERT
if error <> "" then
message("insert.err 1 tfacr4100m000 " & error)
put.ptr=seq.puts(str$(tdsls945.orno) & " " & str$(tdsls945.pono) & "INSERT ERROR " & error,open.ptr)
endif
|

12th April 2011, 15:14
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
|
|
|
Baan: Baan 4C4 A&D1 -
DB: Oracle -
OS: Sun Solaris
|
Well I went into my system, not a clue on what I was doing and picked order type RD1 (it said credit note type), series defaulted to 28, picked a customer, inserted a record. Dropped your code into my test function server and it worked. Session tfacr4101s000 was started in the background. Now I really don't if I actually tested a credit note - no clue where that series came from. Looked around for it, but did not see anything obvious. Not sure if it was really a valid test - I believe we are on SP28 for 4c4. No clue what I am doing and now I need to go do some cleanup with table maintenance on test system.
Have you tried a get field after the error for the series or ninv field? Make sure the series is still correct. Do you own source code where you could debug what happens in the session.
Code:
function creditnote()
{
stpapi.put.field( "tfacr4100m000", "tfacr400.ttyp", "RD1" )
stpapi.put.field( "tfacr4100m000", "tfacr400.ninv", str$(28))
stpapi.put.field( "tfacr4100m000", "tfacr400.cuno", "00500")
stpapi.put.field( "tfacr4100m000", "tfacr400.refr", "Testing")
rc=stpapi.insert( "tfacr4100m000", 1, err ) |INSERT
if err <> "" then
message("insert.err 1 tfacr4100m000 " & err)
stpapi.end.session("tfacr4100m000")
endif
}
__________________
Mark
GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.
Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
|

12th April 2011, 15:35
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Nottingham
Posts: 483
|
|
|
Baan: Baan IVc4 ags0 -
DB: Informix 9.40 UC4 -
OS: Sun Solaris 9
|
|
Hello Mark,
Thanks for the input. This problem is real odd one.
What's the best way of chasing the error I'm afraid my tracing skills aren't that clever these days. I'm guessing that the value of tfacr400.ninv must be incorrect but I can't see how. I've also tried a different credit transaction type but this does the same thing.
Sadly I can't get hold of the source so I'll have to go into debug and have a good look round.
We are only on SP18 for 4c4 so I'm not sure whether that would be an issue. I've checked for later versions of the session but cannot see any.
Cheers Neal
|

12th April 2011, 16:37
|
 |
Guru
|
|
Join Date: Aug 2001
Location: Germany
Posts: 529
|
|
|
Baan: IVc4, ERP LN -
DB: Oracle -
OS: Linux, Unix
|
|
Hello Neal,
I think SP18 could not be the problem. I did a quick test with the code posted by Mark on our old and frozen 4c4 (SP15) and it worked.
Which series are defined for the used transaction type in session tfgld0114m000 "Maintain series per transaction type"?
Regards,
Juergen
|

12th April 2011, 16:51
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Nottingham
Posts: 483
|
|
|
Baan: Baan IVc4 ags0 -
DB: Informix 9.40 UC4 -
OS: Sun Solaris 9
|
|
Hello Juergen,
Thanks for the input. The series for the transactions is defined in tfgld0114m000 for the Credit Type transaction SCN. I can also manually create SCN's for series 4 in the session.
Any chance you can try Mark's code with a Sales Credit Note type transaction this may be the issue.
Cheers
Neal
|

12th April 2011, 17:13
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Nottingham
Posts: 483
|
|
|
Baan: Baan IVc4 ags0 -
DB: Informix 9.40 UC4 -
OS: Sun Solaris 9
|
Hello guys,
Just found the obvious thing I was missing the test Finance Company (which I'd forgotten about) is where the Sales Credit Notes are being created and guess what this company is missing the series !
Feel pretty stupid now but at least everything now makes sense before I go home to sleep on it.
Thanks for your help.
Cheers Neal  
|

12th April 2011, 17:25
|
 |
Guru
|
|
Join Date: Aug 2001
Location: Germany
Posts: 529
|
|
|
Baan: IVc4, ERP LN -
DB: Oracle -
OS: Linux, Unix
|
Hello Neal,
I can feel with you, but tomorrow the world looks already differently 
|

12th April 2011, 20:48
|
 |
Guru
|
|
Join Date: Sep 2001
Location: Louisville, KY, USA
Posts: 5,943
|
|
|
Baan: Baan 4C4 A&D1 -
DB: Oracle -
OS: Sun Solaris
|
Bet there and done that!  Glad you found the solution.
__________________
Mark
GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.
Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|