The COHERENCE_INDEX consistency index retrieval part .
To see the verification part, click on this link
In this case, the goal is to retrieve data related to a command from a database and then expose it in the consistency index table
var database = new JSE_Database("DSN=******");
var datatable = new JSE_Datatable();
var res = database.executeRequest("SELECT * from Items WHERE Numero_BC= '"+getTextFromIndexInfo(getFirstIndexFromID(pParameters, "BC_INDEX"))+"'");
var val=[];
for(i=0;i<res.length;i++){
val.push({
"BC" : res[i]["Numero_BC"],
"BL" : res[i]["Numero BL"],
"Code" : res[i]["Code"],
"NAME" : res[i]["Nom"],
"Quantite" : res[i]["Quantite"],
"PU" : res[i]["Prix unitaire"],
"Total" : res[i]["Total HT"]
});
}
datatable["headers"]=[
{"title":"Numero bon de comande","id":"BC","type":"String"},
{"title":"Numero bon de livraison","id":"BL","type":"String"},
{"title":"Code Produit","id":"Code","type":"String"},
{"title":"Nom","id":"NAME","type":"String"},
{"title":"Quantite","id":"Quantite","type":"String"},
{"title":"Prix unitaire","id":"PU","type":"String"},
{"title":"Total","id":"Total","type":"String"}
];
datatable["values"]=val;
return datatable;