Personal tools

Log in

Changes

From All n One's bxp software Wixi

Jump to: navigation, search

AJAX - API

1,469 bytes added, 19:57, 18 October 2022
no edit summary
strReturnFields = '<span style="color: #00ccff;">intCDA_7_Id,strCDA_7_field_0_1</span>'; fn_bxp_API_FormDataSearch(true, '<span style="color: #ffcc00;">client_example</span>'<span style="color: #cc99ff;">, , , true</span>, <span style="color: #ff00ff;">7</span>,strReturnFields,'(<span style="color: #ff99cc;">strCDA_7_field_0_5 = ' + document.getElementById('searchField').value + ' AND strCDA_7_field_0_1 > NOW()</span>)','','intCDA_7_Id',<span style="color: #99ccff;">1000</span>,'<span style="color: #ff6600;">strApiRetrieveResult</span>','console.log("API Retrieve Start")','<span style="color: #00ff00;">fn_AfterRetrieveResults();</span>','<span style="color: #3366ff;">console.log("API Retrieve Fail")</span>'); In this example the API will attempt to query <span style="color: #ff00ff;">Form 7</span> from the <span style="color: #ffcc00;">client_example</span> system. <span style="color: #cc99ff;">The function will attempt to use the users current session to authenticate, the ID and Key fields are left blank as a result</span>.
fn_bxp_API_FormDataSearch(true, 'client_example', '', '', true, 7,strReturnFields,'(strCDA_7_field_0_5 The query will bring back the <span style= ' + document.getElementById('intCDA_Id')."color: #00ccff;">record ID and value + ' AND strCDA_7_field_0_1 of field 1</span> NOW())','','intCDA_7_Id',for <span style="color: #99ccff;">up to 1000,'results</span> <span style="color: #ff99cc;">where the date stored in field 1 is some time beyond the present date and the value stored in field 5 matches the value of the page element "searchField" </span> <span style="color: #ff99cc;"><span style="color: #000000;">The results of the query will be stored in the global variable</span> <span style="color: #ff6600;">strApiRetrieveResult','console.log(<span style="color: #000000;"> and the function <span style="API Retrieve Startcolor: #00ff00;">fn_AfterRetrieveResults()'</span>will run after a successful query result is returned,'fn_ADS_AfterRetrieveFutureBookings()<span style="color: #3366ff;'">otherwise,'console.log("API Retrieve Fail")');will be printed to the console</span>.</span></span></span>
343
edits