You can programmatically build a template with all the visible fields for multiple layers. This is how I did it for one application, but I also had modified the MXD file for the service to show only certain fields with aliases. This also leaves off the OBJECTID and SHAPE fields from the content.
function executeIdentifyTask(evt) {
map.graphics.clear();
identifyParams.geometry = evt.mapPoint;
identifyParams.mapExtent = map.extent;
var deferred = identifyTask.execute(identifyParams);
deferred.addCallback(function (response) {
return dojo.map(response, function (result) {
var feature = result.feature;
var contentString = "";
var sp = feature.attributes;
contentString += "<b>" + result.layerName + "</b><hr width = '90%'>";
for (var x in sp) {
if (x !== "OBJECTID" && x !== "Shape") {
contentString += "<i>" + x + "</i>: " + feature.attributes + "<br/>";
}
}
var infoTemplate = new esri.InfoTemplate();
infoTemplate.setTitle("Results");
infoTemplate.setContent(contentString);
feature.setInfoTemplate(infoTemplate);
return feature;
});
});
map.infoWindow.setFeatures([deferred]);
map.infoWindow.show(evt.mapPoint);
}