I apologize as I am mistaken. It appears that currently all of the XResultSet commands are not allowed in Mass Update on the Server. I'm looking into why this is and to see if we can allow most of them, with the exception of the ones that reference the form, in a Mass Update on the Engine in a future update of Sesame.
But your current code can be rewritten to be faster.
One thing you can do to make it faster is currently you are calling @XResultSetNew() and @XResultSetClose() twice per record. What I would recommend doing is call the @XResultSetNew() calls in Global Code, set the returns to a Stat and use that in your code. Then at the bottom of your current code check if you are on the last record.
If @ResultSetCurrentPosition() = @ResultSetTotal() Then
and inside the If Statement, close the XResultSets.
Then:
XResultSetValue(vNewitem, "ITEMCODE0", vC1)
XResultSetValue(vNewitem, "TRANSDATE0", vLE0 )
XResultSetValue(vNewitem, "TRANSNUMBER00", vINVOICE)
XResultSetValue(vNewitem, "TRANSSUBNUMBER0", vITEMNUM)
XResultSetValue(vNewitem, "SRTOUT0", vSROUT)
XResultSetValue(vNewitem, "SMTOUT0", vSMOUT)
XResultSetValue(vNewitem, "ANTOUT0", vANOUT)
XResultSetValue(vNewitem, "NGTOUT0", vNGOUT)
XResultSetValue(vNewitem, "TOTALOUT0", vTOTALOUT )
XResultSetValue(vNewitem, "SALES", vLNET1)
Can be written as
XResultSetValue(vNewitem, "ITEMCODE0", vC1, "TRANSDATE0", vLE0, "TRANSNUMBER00", vINVOICE, "TRANSSUBNUMBER0", vITEMNUM, "SRTOUT0", vSROUT, "SMTOUT0", vSMOUT, "ANTOUT0", vANOUT, "NGTOUT0", vNGOUT, "TOTALOUT0", vTOTALOUT, "SALES", vLNET1)
And the same thing can be done with the other set of XResultSetValue commands.
-Ray