I made a service separate that add automatically the number.
The service is only call in Mashup and don't need another specifies connexions except Clicked button trigger and Loaded Trigger from Mashup.
try{
var dtValues= Things["AuditItBOS_Schedule"].GetDataTableEntries({
maxItems: 99999 /* NUMBER {"defaultValue":500} */
});
var dtMaxParams = {
t: dtValues, // INFOTABLE
columns: "ID", // STRING
aggregates: "MAX", // STRING
groupByColumns: undefined // STRING
};
var dtMax = parseInt(Resources["InfoTableFunctions"].Aggregate(dtMaxParams).MAX_ID); //INFOTABLE
}
catch(err){
result = "Service call error ["+me.name + "]: on line " + err.lineNumber + ". Error Name: " + err.name + ". Error Message: " + err.message;
}
var result = dtMax+1;