chaitanya.shah
1st September 2020, 15:46
Hi,
I am working in fp9.
I have create afs for tfgld1101m000 and try to insert data but system link last document with last batch.
I want to link with specific batch document.
please check below code :-
function extern afs.create.payment.advice()
{
|#Insert Detail Payment Advice
| stpapi.synchronize.dialog("tfcmg1509m000","add",error.msg)
| stpapi.change.view("tfcmg1609m000",error.msg)
| if isspace(error.msg) then
| stpapi.get.field("tfcmg1509m000","tfcmg109.btno",batch.pay.afs)
| stpapi.end.session("tfcmg1509m000",error.msg)
batch.pay.afs = "27720"
message(str$(batch.pay.afs))
| stpapi.synchronize.dialog("tfcmg1609m000","add",error.msg)
stpapi.synchronize.dialog("tfcmg1101m000","add",error.msg)
| stpapi.put.field("tfcmg1101m000","tfcmg101.btno",batch.pay.afs)
stpapi.put.field("tfcmg1101m000","tfcmg101.ifbp",str$("SUP002210"))
stpapi.put.field("tfcmg1101m000","tfcmg101.comp",str$(203))
stpapi.put.field("tfcmg1101m000","tfcmg101.tadv",str$(etol(tfcmg.tadv.purinv)))
stpapi.put.field("tfcmg1101m000","tfcmg101.ttyp",str$("APE"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ninv",str$("19204706"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ptbp",str$("SUP002210"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ccur",str$("INR"))
amnt = 2018.00
stpapi.put.field("tfcmg1101m000","tfcmg101.amnt",str$(amnt))
stpapi.put.field("tfcmg1101m000","tfcmg101.refr",str$("PMS/T/4306/19"))
stpapi.put.field("tfcmg1101m000","tfcmg101.paym","NEFT")
ret = stpapi.insert("tfcmg1101m000",true,error.msg)
if ret = 1 then
stpapi.get.field("tfcmg1101m000", "tfcmg101.btno", batch.pay.afs)
message("Insert (Batch Number %s): %s", batch.pay.afs, error.msg)
else
message(error.msg)
endif
| else
| stpapi.end.session("tfcmg1101m000",error.msg)
| stpapi.end.session("tfcmg1609m000",error.msg)
| message("Synchronize Error= "&error.msg)
| error.msg=""
| endif
}
I am working in fp9.
I have create afs for tfgld1101m000 and try to insert data but system link last document with last batch.
I want to link with specific batch document.
please check below code :-
function extern afs.create.payment.advice()
{
|#Insert Detail Payment Advice
| stpapi.synchronize.dialog("tfcmg1509m000","add",error.msg)
| stpapi.change.view("tfcmg1609m000",error.msg)
| if isspace(error.msg) then
| stpapi.get.field("tfcmg1509m000","tfcmg109.btno",batch.pay.afs)
| stpapi.end.session("tfcmg1509m000",error.msg)
batch.pay.afs = "27720"
message(str$(batch.pay.afs))
| stpapi.synchronize.dialog("tfcmg1609m000","add",error.msg)
stpapi.synchronize.dialog("tfcmg1101m000","add",error.msg)
| stpapi.put.field("tfcmg1101m000","tfcmg101.btno",batch.pay.afs)
stpapi.put.field("tfcmg1101m000","tfcmg101.ifbp",str$("SUP002210"))
stpapi.put.field("tfcmg1101m000","tfcmg101.comp",str$(203))
stpapi.put.field("tfcmg1101m000","tfcmg101.tadv",str$(etol(tfcmg.tadv.purinv)))
stpapi.put.field("tfcmg1101m000","tfcmg101.ttyp",str$("APE"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ninv",str$("19204706"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ptbp",str$("SUP002210"))
stpapi.put.field("tfcmg1101m000","tfcmg101.ccur",str$("INR"))
amnt = 2018.00
stpapi.put.field("tfcmg1101m000","tfcmg101.amnt",str$(amnt))
stpapi.put.field("tfcmg1101m000","tfcmg101.refr",str$("PMS/T/4306/19"))
stpapi.put.field("tfcmg1101m000","tfcmg101.paym","NEFT")
ret = stpapi.insert("tfcmg1101m000",true,error.msg)
if ret = 1 then
stpapi.get.field("tfcmg1101m000", "tfcmg101.btno", batch.pay.afs)
message("Insert (Batch Number %s): %s", batch.pay.afs, error.msg)
else
message(error.msg)
endif
| else
| stpapi.end.session("tfcmg1101m000",error.msg)
| stpapi.end.session("tfcmg1609m000",error.msg)
| message("Synchronize Error= "&error.msg)
| error.msg=""
| endif
}