Hi team!
Im doing one query that give a sum of cycle time depending the item.type. I need to use the code several times and i need to add another variables so i need to create a "user command" and only copy and paste in each process where i need it, i tried to do it but without success.
Could you please help me and explain me a little bit the parameters and how interact in the usser command please?
Attached model for reference
Code below that i need to make a "user command":
Object current = ownerobject(c); Object item = param(1); int value=item.Type; Table resultsArray=Table.query("SELECT SUM ([CT]) AS total FROM GlobalTable1 WHERE [Type]=="+value+""); setlabel(item,"CT",resultsArray[1][1]); return resultsArray[1][1];
thanks a lot