Neal Matthews
12th April 2011, 12:41
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
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
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
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
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
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