#Print the result to the console
print call.getReturnValue()
Result:
caused by Exception: Error executing system.db.execSProcCall()
caused by GatewayException: Error trying to coerce ‘WOID’ [String] to a class java.lang.Integer
Not sure what to do from here… I assume I would need to use “toInt” just not sure where…
First try removing the quotes from your variable names:
MachID = event.source.parent.getComponent('MachineID').selectedLabel
WOID = event.source.parent.getComponent('WorkOrder').selectedLabel
call = system.db.createSProcCall("spSetMachineWorkOrder","mdvsites")
call.registerReturnParam(system.db.INTEGER)
call.registerInParam(1, system.db.VARCHAR, MachID) #<--------------- HERE
call.registerInParam(2, system.db.INTEGER, WOID) #<--------------- AND HERE
system.db.execSProcCall(call)
#Print the result to the console
print call.getReturnValue()
MachID = event.source.parent.getComponent('MachineID').selectedLabel
WOID = event.source.parent.getComponent('WorkOrder').selectedLabel
call = system.db.createSProcCall("spSetMachineWorkOrder","mdvsites")
call.registerReturnParam(system.db.INTEGER)
call.registerInParam(1, system.db.VARCHAR, MachID)
call.registerInParam(2, system.db.INTEGER, int(WOID)) #<--------------- USE INT HERE
system.db.execSProcCall(call)
#Print the result to the console
print call.getReturnValue()