Changes

JavaScript AJAX Functions

2,182 bytes added, 11:34, 7 October 2016
no edit summary
* New Ajax function - "InsertCount"
* New Ajax function - "dbInsertRecord"
* New Ajax function - "InsertFromClient"
</source>
 
 
 
"InsertFromClient"
 
This function allows you to transfer user information from the client database into database fields in the form. In the following example, the value of the clients id and first name is transferred into strCDA_883_field_0_0,strCDA_883_field_0_1.
 
Worked example
 
<source lang="javascript" collapse="true" first-line="1">
if (typeof aryAjax_Settings=='undefined'){
alert('Library did not load');
}else {
aryAjax_Settings[0] = 'client_demo'; //Your system name
aryAjax_Settings[1] = ''; //The CMI API Username
aryAjax_Settings[2] = ''; //The CMI API User password
aryAjax_Settings[3] = ''; //The campaign which contains the product list
aryAjax_Settings[4] = 'intClient_Id'; //The field which contains the limiting / grouping factor
aryAjax_Settings[5] = '225'; //The value to limit the responses by, in this case only yes items
aryAjax_Settings[13] = -1; //Limit responses -1 do not limit
aryAjax_Settings[14] = 'false'; //Draw a table
aryAjax_Settings[15] = 'divWarning'; //Where to draw error messages if any
aryAjax_Settings[16] = 'InsertFromClient'; //Engine to use i.e. Populate
 
aryAjax_Settings[6] = 'intClient_Id,strClient_Firstname'; //The field in the other campaign to be returned order = value, text
aryAjax_Settings[12] = 'ID,FirstName'; //Headings for xml troubleshooting
aryAjax_Settings[17] = 'strCDA_883_field_0_0,strCDA_883_field_0_1'; //The field in the current campaign into which the products will be inserted.
 
aryAjax_Settings[22] = document.getElementById('intSystemGenerated_CompanyId').value; //Auto Login - System
aryAjax_Settings[23] = document.getElementById('intSystemGenerated_UserId').value; //Auto Login - User
aryAjax_Settings[24] = document.getElementById('intSystemGenerated_LoginKey').value; //Auto Login - SessionId
 
fn_Ajax_BE_Process();
}
 
</source>
 
[[Category:Topic:bxp API]]
[[Category:Topic:JavaScript]]
7,528
edits