343
edits
Changes
→fn_bxp_API_FormDataInsertUpdate( )
strFieldsToUpdate = <span style="color: #ff99cc;">'</span><span style="color: #99ccff;">&intCDA_161_Id=100</span><span style="color: #ff99cc;">&strCDA_161_Status="Application form completed"&strCDA_161_field_0_0="' + document.getElementById('FieldA').value + '"&strCDA_161_field_0_1="' + document.getElementById('FieldB').value + '"&strCDA_161_field_0_12="' + document.getElementById('FieldC').value + '"&strCDA_161_field_0_13="' + document.getElementById('FieldD').value + '"'
<span style="color: #000000;">strFieldsToInsert =</span> <span style="color: #993366;">'</span><span style="color: #ff99cc;"><span style="color: #993366;">&strCDA_161_Status="Application form completed"&strCDA_161_field_0_0="' + document.getElementById('FieldA').value + '"&strCDA_161_field_0_1="' + document.getElementById('FieldB').value + '"&strCDA_161_field_0_12="' + document.getElementById('FieldC').value + '"&strCDA_161_field_0_13="' + document.getElementById('FieldD').value + '"'</span>
</span></span>fn_bxp_API_FormDataInsertUpdate(true, '<span style="color: #ffcc00;">client_example</span>', '<span style="color: #cc99ff;">API_Application_FormAPI_Example</span>', '<span style="color: #cc99ff;">__29dhtbfji__29dhtbfji__29dhtbfji<span style="background-color: #ffddcc;">__123456789!!</span></span>', <span style="color: #cc99ff;">false</span>, '<span style="color: #ff00ff;">161</span>', strFieldsToUpdate, '<span style="color: #ff0000;">strApiUpdateResult</span>', 'console.log(\'API Insert start\')', '<span style="color: #339966;">console.log(\'API Insert Success: \' + strApiInsertResult);fn_AfterSubmit();</span>', '<span style="color: #3366ff;">console.log(\'API Update Fail: \' + strApiInsertResult)</span>');
In this example the API will attempt to update <span style="color: #ff00ff;">Form 161</span> from the <span style="color: #ffcc00;">client_example</span> system. <span style="color: #cc99ff;">The function will attempt to use the the ID and Key for API_Application_Form API_Example to authenticate</span>.
<span style="color: #ff99cc;"><span style="color: #000000;">The update will</span> set the Status to "Application form completed" and the values of fields 0,1,12 and 13 to the values of page elements FieldA through FieldD respectively</span> <span style="color: #99ccff;">for record ID 100. <span style="color: #000000;">Alternatively, if the variable</span> <span style="color: #993366;">strFieldsToInsert</span> <span style="color: #000000;">were used instead of strFieldsToUpdate,</span> <span style="color: #993366;">a new record with the same values as above would be inserted into the form instead.</span></span>
<span style="color: #ff99cc;"><span style="color: #000000;">The results of the update will be stored in the global variable</span><span style="color: #ff99cc;"> </span><span style="color: #ff6600;">strApiUpdateResult</span><span style="color: #ff6600;">, <span style="color: #339966;">"API Update Success will be printed to the console"</span><span style="color: #ff6600;"> </span><span style="color: #000000;">and the function <span style="color: #00ff00;"><span style="color: #339966;">fn_AfterSubmit()</span> </span>will run after a successful result is returned, <span style="color: #3366ff;">otherwise, "API Update Fail" will be printed to the console</span>.</span></span></span>
====fn_bxp_API_eCourseSearch( )====