Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<html><head><title>devicerowidExample</title><script type="text/javascript"> 
 
function onSaveJSON() { 
	return "[{\"action\":\"select\",\"invoke\":\"updateDSDeviceRowId\",\"parameters\":[{\" modulefields\": [ { \"module\":\"2\", \"fields\":\"uid,devicerowid\"} ],\"filter\":\"2.uid=$2.uid\"} ] } ]";
}
 
function updateDSDeviceRowId(rows) {
	var jsonscript = "["; 
	if(rows.length > 0){
		jsonscript += "{\"action\":\"update\",\"module\":\"2\",\"uid\":\"" + rows[0]._2.uid + "\",\"fields\":[ { \"field\":\"CONTTXT01\", \"value\":\""+rows[0]._2.devicerowid+"\"} ], \"upsync\":\"yes\", \"filter\":\"2.uid ="+rows[0]._2.uid+"\" }";
 	}
 	jsonscript += "]";
 	return jsonscript;
}
 
function onErrorInvoke(rows){
	if(rows.length > 0){
		window.location="melt://showAlert:"+ rows[0].message;
	}
}
</script></head><body></body></html>

2.  Writing the openExternalApp Function

...