{"id":21338,"date":"2024-03-11T15:12:05","date_gmt":"2024-03-11T14:12:05","guid":{"rendered":"https:\/\/help.openbee.com\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_datatable-comparison-of-total\/"},"modified":"2026-05-13T09:35:25","modified_gmt":"2026-05-13T07:35:25","slug":"consistency-1-jse_datatable-comparison-of-total","status":"publish","type":"page","link":"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_datatable-comparison-of-total\/","title":{"rendered":"Consistency (1): JSE_Datatable: Comparison of Total"},"content":{"rendered":"\n<p><strong>The COHERENCE_INDEX consistency index retrieval part<\/strong> .  <br\/>To see the verification part, <a href=\"https:\/\/help.openbee.com\/en\/open-bee-scan-capture\/knowledge-base\/how-to-guides\/scripts-in-capture\/case-studies\/index\/consistency-1-jse_consistency_result-comparison-of-total\/\">click on this link<\/a><\/p>\n\n<p>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<\/p>\n\n<pre class=\"wp-block-code\"><code>var database = new JSE_Database(\"DSN=******\");\nvar datatable = new JSE_Datatable();\n\nvar res = database.executeRequest(\"SELECT * from Items WHERE Numero_BC= '\"+getTextFromIndexInfo(getFirstIndexFromID(pParameters, \"BC_INDEX\"))+\"'\");\n\nvar val=&#91;];\nfor(i=0;i&lt;res.length;i++){\n\tval.push({\n\t\t\"BC\" : res&#91;i]&#91;\"Numero_BC\"],\n\t\t\"BL\" : res&#91;i]&#91;\"Numero BL\"],\n\t\t\"Code\" : res&#91;i]&#91;\"Code\"],\n\t\t\"NAME\" : res&#91;i]&#91;\"Nom\"],\n\t\t\"Quantite\" : res&#91;i]&#91;\"Quantite\"],\n\t\t\"PU\" : res&#91;i]&#91;\"Prix unitaire\"],\n\t\t\"Total\" : res&#91;i]&#91;\"Total HT\"]\n\t});\n}\n\n\ndatatable&#91;\"headers\"]=&#91;\n\t\t{\"title\":\"Numero bon de comande\",\"id\":\"BC\",\"type\":\"String\"},\n\t\t{\"title\":\"Numero bon de livraison\",\"id\":\"BL\",\"type\":\"String\"},\n\t\t{\"title\":\"Code Produit\",\"id\":\"Code\",\"type\":\"String\"},\n\t\t{\"title\":\"Nom\",\"id\":\"NAME\",\"type\":\"String\"},\n\t\t{\"title\":\"Quantite\",\"id\":\"Quantite\",\"type\":\"String\"},\n\t\t{\"title\":\"Prix unitaire\",\"id\":\"PU\",\"type\":\"String\"},\n\t\t{\"title\":\"Total\",\"id\":\"Total\",\"type\":\"String\"}\t\n\t];\ndatatable&#91;\"values\"]=val;\n\nreturn datatable;\n\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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<\/p>\n","protected":false},"author":97,"featured_media":0,"parent":21276,"menu_order":13,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-21338","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/users\/97"}],"replies":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/comments?post=21338"}],"version-history":[{"count":1,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21338\/revisions"}],"predecessor-version":[{"id":21341,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21338\/revisions\/21341"}],"up":[{"embeddable":true,"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/pages\/21276"}],"wp:attachment":[{"href":"https:\/\/help.openbee.com\/en\/wp-json\/wp\/v2\/media?parent=21338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}