jayugandhi
24th June 2014, 15:07
Hi,

I am trying to do a bank transaction in session tfgld1101m000>tfcmg2500m000>tfacp2103s000 through afs.

I am getting an error "It is not allowed to change tax ledger account field" on session tfacp2103s000 which is my last process.

I can change ledger account directly from session without any error message.
please help me to solve this why this message is coming!

below is my code-

ret = stpapi.mark("tfcmg2500m000", err.msg)
stpapi.handle.subproc("tfcmg2500m000", "tfacp2103s000", "modify")
stpapi.form.command("tfcmg2500m000", 5, "handle.withholding.tax", err.msg)
ret = stpapi.mark("tfacp2103s000", err.msg)
ret = stpapi.synchronize.dialog("tfacp2103s000", "modify", err.msg)
if ret = 1 then
select ltmig022.*
from ltmig022
where ltmig022._index1 = {"MAP", "PEW"}
as set with 1 rows
selectdo
endselect
stpapi.put.field("tfacp2103s000", "tfacp203.year", str$(2014))
stpapi.put.field("tfacp2103s000", "tfacp203.leac", ltmig022.leac1)
stpapi.put.field("tfacp2103s000", "tfacp203.dim1", ltmig022.loca)
stpapi.put.field("tfacp2103s000", "tfacp203.dim2", ltmig022.coeu)

ret = stpapi.update("tfacp2103s000", true, err.msg)

endif

bhushanchanda
24th June 2014, 17:46
Hi,

Check if you are taking care of all the required fields. Also, try setting the values of dim1, 2 before setting the ledger code. The DAL checks might be causing the issues.

mark_h
24th June 2014, 18:35
Since this is LN I won't be much assistance - the question I have is from looking at the documentation when you use the sync dialog command the update command is on the main session like the example below - so is the sync needed? Not sure myself and I would look at what bhushan has posted first.

stpapi.put.field("dtfsa1501m000", "dtfsa101.seno", str$(i.seno))
ret = stpapi.find("dtfsa1501m000", error.msg)
if ret then
ret = stpapi.synchronize.dialog("dtfsa1501m000", "modify", error.msg)
if ret then
stpapi.put.field("dtfsa1101s000", "dtfsa101.name", new.name)
ret = stpapi.update("dtfsa1501m000", true, error.msg)
endif
endif