sachinbaan
31st July 2014, 12:08
Hi,
I am writing AFS on tcmcs0536m000 - Tax Codes By Country, to approve range of tax together
During approve operation if any of the tax throws any message(error, info) I want it in error report, but in AFS I am not getting that message in my "error.message" variable.
please help.
function extern approve.tax.code()
{
brp = brp.open("rltmcs0536m0001", "D", 0)
select tcmcs036.ccty, tcmcs036.cvat
from tcmcs036
where tcmcs036._index1 inrange {:tax.country, :tax.code.from} and {:tax.country, :tax.code.to}
and tcmcs036.stpv.l = :tax.state
and tcmcs036.appr = tcyesno.no
selectdo
stpapi.put.field("tcmcs0536m000", "tcmcs036.ccty", tcmcs036.ccty)
ret = stpapi.change.view("tcmcs0536m000", error.message)
if ret = 1 then
stpapi.put.field("tcmcs0536m000", "tcmcs036.ccty", tcmcs036.ccty)
stpapi.put.field("tcmcs0536m000", "tcmcs036.cvat", tcmcs036.cvat)
ret = stpapi.find("tcmcs0536m000", error.message)
if ret = 1 then
ret = stpapi.mark("tcmcs0536m000", error.message)
if ret = 1 then
stpapi.form.command("tcmcs0536m000", 5, "approve.tax.code", error.message)
stpapi.enum.answer("tcmcs0536m000", "tcmcs00003", tcyesno.yes)
select tcmcs036.ccty
from tcmcs036
where tcmcs036._index1 = {:tcmcs036.ccty, :tcmcs036.cvat}
and tcmcs036.stpv.l = :tax.state
and tcmcs036.appr = tcyesno.yes
as set with 1 rows
selectempty
error.message = "Tax Code not approved."
brp.ready(brp)
stpapi.end.session("tcmcs0536m000")
endselect
endif
else
stpapi.end.session("tcmcs0536m000")
endif
else
stpapi.end.session("tcmcs0536m000")
endif
selectempty
message("No Data Within Selection.")
endselect
brp.close(brp)
}
I am writing AFS on tcmcs0536m000 - Tax Codes By Country, to approve range of tax together
During approve operation if any of the tax throws any message(error, info) I want it in error report, but in AFS I am not getting that message in my "error.message" variable.
please help.
function extern approve.tax.code()
{
brp = brp.open("rltmcs0536m0001", "D", 0)
select tcmcs036.ccty, tcmcs036.cvat
from tcmcs036
where tcmcs036._index1 inrange {:tax.country, :tax.code.from} and {:tax.country, :tax.code.to}
and tcmcs036.stpv.l = :tax.state
and tcmcs036.appr = tcyesno.no
selectdo
stpapi.put.field("tcmcs0536m000", "tcmcs036.ccty", tcmcs036.ccty)
ret = stpapi.change.view("tcmcs0536m000", error.message)
if ret = 1 then
stpapi.put.field("tcmcs0536m000", "tcmcs036.ccty", tcmcs036.ccty)
stpapi.put.field("tcmcs0536m000", "tcmcs036.cvat", tcmcs036.cvat)
ret = stpapi.find("tcmcs0536m000", error.message)
if ret = 1 then
ret = stpapi.mark("tcmcs0536m000", error.message)
if ret = 1 then
stpapi.form.command("tcmcs0536m000", 5, "approve.tax.code", error.message)
stpapi.enum.answer("tcmcs0536m000", "tcmcs00003", tcyesno.yes)
select tcmcs036.ccty
from tcmcs036
where tcmcs036._index1 = {:tcmcs036.ccty, :tcmcs036.cvat}
and tcmcs036.stpv.l = :tax.state
and tcmcs036.appr = tcyesno.yes
as set with 1 rows
selectempty
error.message = "Tax Code not approved."
brp.ready(brp)
stpapi.end.session("tcmcs0536m000")
endselect
endif
else
stpapi.end.session("tcmcs0536m000")
endif
else
stpapi.end.session("tcmcs0536m000")
endif
selectempty
message("No Data Within Selection.")
endselect
brp.close(brp)
}