samsan
16th May 2013, 17:42
Hello,

Is there a mean to retrieve the AFS error messages in other language than english ?

Thank you in advance

mark_h
16th May 2013, 18:11
I am not sure I understand what you mean. I would think the error messages would be in what ever language the session was run in. See below code for one I just completed. In this case the error I get from the insert is "Location not in location table" - I knew the location was bad just to test. I would expect that error to be in the language of the session.


unction extern domain tcbool insert.fixed.location( domain tcitem vss.item,
domain tccwar vss.cwar,
domain tcmcs.str8 vss.stat,
ref string msg())
{
tt.align.according.domain(vss.stat,vss.stat,"tdilc.loca")
fserr = ""
stpapi.put.field("tdilc0130m000","tdilc007.cprj","")
stpapi.put.field("tdilc0130m000","tdilc007.item",vss.item)
stpapi.put.field("tdilc0130m000","tdilc007.cntr","")
stpapi.put.field("tdilc0130m000","tdilc007.cwar",vss.cwar)
ret.code = stpapi.change.view( "tdilc0130m000" )
stpapi.put.field("tdilc0130m000","tdilc007.cprj","")
stpapi.put.field("tdilc0130m000","tdilc007.item",vss.item)
stpapi.put.field("tdilc0130m000","tdilc007.cntr","")
stpapi.put.field("tdilc0130m000","tdilc007.cwar",vss.cwar)
stpapi.put.field("tdilc0130m000","tdilc007.loca",vss.stat)
stpapi.put.field("tdilc0130m000","tipgc007.filo",str$(tcyesno.yes))
stpapi.insert("tdilc0130m000",true,fserr)
if(strip$(fserr)<>"") then
msg = fserr
stpapi.end.session("tdilc0130m000")
return(true)
endif
stpapi.end.session("tdilc0130m000")
return(false)
}

samsan
16th May 2013, 18:20
Thanks for your answer.

I'm writing a session using the AFS function of tdsls4102s000 to modify the planned delivery date.
When the modification is not allowed, I get the error message which is the same than when I use the standard session, but in english even if my user has the french language set.

mark_h
16th May 2013, 18:51
Can you use stpapi.get.mess.code to get the message code? Then maybe use the message code for the users language to display for them?

samsan
17th May 2013, 14:31
I understand.

Thank you very much