sachinbaan
6th May 2014, 12:04
Hi,
I am following below procedure,
1. Generating Installment through AFS.
2. Now using form command i m opening session of "contract Shipment"
3. here i want check "Linked" field to "yes", though AFS, but its not getting.
written below code.
function extern domain tcbool ltpindllafscal.tppin4151m000.link.shipment(
domain tccono i.cono, domain tpctm.cnln i.cnln,
domain tcpono i.dlvr, domain tcpono i.schd,
domain tccprj i.cprj, domain tppdm.cspa i.cspa,
domain tppss.cpla i.cpla, domain tppdm.cact i.cact,
domain whinh.shpm i.shpm, domain tcpono i.pono,
domain tppdm.nins i.nins, ref string error.msg)
{
long ret
ret = stpapi.find("tppin4151m000", error.msg)
if ret = 1 then
stpapi.put.field("tppin4151m000", "tppin020.cono", i.cono)
stpapi.put.field("tppin4151m000", "tppin020.cnln", i.cnln)
stpapi.put.field("tppin4151m000", "tppin020.nins", str$(i.nins))
ret = stpapi.find("tppin4151m000", error.msg)
if ret = 1 then
if ret then
stpapi.form.command("tppin4151m000", 5, "start.shipments", error.msg)
if isspace(error.msg) then
stpapi.put.field("tppin0160m000", "tppin060.cono", i.cono)
stpapi.put.field("tppin0160m000", "tppin060.cnln", i.cnln)
stpapi.put.field("tppin0160m000", "tppin060.dlvr", str$(i.dlvr))
stpapi.put.field("tppin0160m000", "tppin060.schd", str$(i.schd))
stpapi.put.field("tppin0160m000", "tppin060.cprj", i.cprj)
stpapi.put.field("tppin0160m000", "tppin060.cspa", str$(i.cspa))
stpapi.put.field("tppin0160m000", "tppin060.cpla", str$(i.cpla))
stpapi.put.field("tppin0160m000", "tppin060.cact", str$(i.cact))
stpapi.put.field("tppin0160m000", "tppin060.shpm", i.shpm)
stpapi.put.field("tppin0160m000", "tppin060.pono", str$(i.pono))
ret = stpapi.find("tppin0160m000", error.msg)
if ret = 1 then
ret = stpapi.synchronize.dialog("tppin0160m000", "modify", error.msg)
if ret then
stpapi.put.field("tppin0160m000", "tppin060.link", str$(etol(tcyesno.yes))) ret = stpapi.update("tppin0160m000", true, error.msg)
if ret then
stpapi.end.session("tppin0160m000")
return(true)
else
stpapi.end.session("tppin0160m000")
stpapi.end.session("tppin4151m000")
return(false)
endif
endif
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
return(false)
endif
stpapi.end.session("tppin0160m000")
return(true)
}
I am following below procedure,
1. Generating Installment through AFS.
2. Now using form command i m opening session of "contract Shipment"
3. here i want check "Linked" field to "yes", though AFS, but its not getting.
written below code.
function extern domain tcbool ltpindllafscal.tppin4151m000.link.shipment(
domain tccono i.cono, domain tpctm.cnln i.cnln,
domain tcpono i.dlvr, domain tcpono i.schd,
domain tccprj i.cprj, domain tppdm.cspa i.cspa,
domain tppss.cpla i.cpla, domain tppdm.cact i.cact,
domain whinh.shpm i.shpm, domain tcpono i.pono,
domain tppdm.nins i.nins, ref string error.msg)
{
long ret
ret = stpapi.find("tppin4151m000", error.msg)
if ret = 1 then
stpapi.put.field("tppin4151m000", "tppin020.cono", i.cono)
stpapi.put.field("tppin4151m000", "tppin020.cnln", i.cnln)
stpapi.put.field("tppin4151m000", "tppin020.nins", str$(i.nins))
ret = stpapi.find("tppin4151m000", error.msg)
if ret = 1 then
if ret then
stpapi.form.command("tppin4151m000", 5, "start.shipments", error.msg)
if isspace(error.msg) then
stpapi.put.field("tppin0160m000", "tppin060.cono", i.cono)
stpapi.put.field("tppin0160m000", "tppin060.cnln", i.cnln)
stpapi.put.field("tppin0160m000", "tppin060.dlvr", str$(i.dlvr))
stpapi.put.field("tppin0160m000", "tppin060.schd", str$(i.schd))
stpapi.put.field("tppin0160m000", "tppin060.cprj", i.cprj)
stpapi.put.field("tppin0160m000", "tppin060.cspa", str$(i.cspa))
stpapi.put.field("tppin0160m000", "tppin060.cpla", str$(i.cpla))
stpapi.put.field("tppin0160m000", "tppin060.cact", str$(i.cact))
stpapi.put.field("tppin0160m000", "tppin060.shpm", i.shpm)
stpapi.put.field("tppin0160m000", "tppin060.pono", str$(i.pono))
ret = stpapi.find("tppin0160m000", error.msg)
if ret = 1 then
ret = stpapi.synchronize.dialog("tppin0160m000", "modify", error.msg)
if ret then
stpapi.put.field("tppin0160m000", "tppin060.link", str$(etol(tcyesno.yes))) ret = stpapi.update("tppin0160m000", true, error.msg)
if ret then
stpapi.end.session("tppin0160m000")
return(true)
else
stpapi.end.session("tppin0160m000")
stpapi.end.session("tppin4151m000")
return(false)
endif
endif
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
stpapi.end.session("tppin4151m000")
return(false)
endif
else
return(false)
endif
stpapi.end.session("tppin0160m000")
return(true)
}