2,332 bytes added,
12:23, 27 April 2012 As with self referencing campaigns BE has the ability to dynamically lookup data from an existing campaign. Unlike self referencing campaigns, you may wish to retrieve data from another campaign which is also possible. So if data can be retrieved it can also be inserted into fields to save on data repitition. A data injection is looking up data from a campaign and then inserting the retrieved data (if there is any) into fields in the current campaign. This can save a ton of data entry for users.
The setup of the retrieval is exactly the same as a self referencing campaign. It is useful to do self referencing first to ensure the data is being retrieved correctly.
Once the data is retrieved with two small changes, the retrieved data can be inserted into the desired fields.
Examining the self referencing function
<syntaxhighlight lang="javascript" line="1">
/*--------------------------------------
// The Self Referencing Lookup settings
--------------------------------------*/
function fn_SelfReferencing() {
if (typeof aryAjax_Settings=="undefined")
alert("Library did not load");
else {
var strValue = document.getElementById('Some_Field_In_Script').value;
aryAjax_Settings[0] = "client_demo"; //The system to use
aryAjax_Settings[1] = "automatic"; //The automation username
aryAjax_Settings[2] = "passkey"; //The automation users password
aryAjax_Settings[3] = "1"; //The Id of the campaign
aryAjax_Settings[4] = "strCDA_1_field_0_0"; //The search field
aryAjax_Settings[5] = strValue; //The search value
aryAjax_Settings[13] = "-1"; //Id of the current record, used for delimiting and not repeating current case
aryAjax_Settings[14] = "true"; //Click through to campaign?
aryAjax_Settings[15] = "divWarning"; //The id of the destination to which the table will be inserted
aryAjax_Settings[16] = "Table"; //The types of processing. Table or Insert
//The fields to be returned into the array
//The column names of those fields
//The first field must always be the ID of the campaign
aryAjax_Settings[6] = "intCDA_1_Id,strCDA_1_field_0_0,strCDA_1_field_0_1";
aryAjax_Settings[12] = "Id,Field 1,Field 2";
aryAjax_Settings[17] = "intCDA_1_Id,strCDA_1_field_0_0,strCDA_1_field_0_1";
fn_Ajax_BE_Process();
}
}
</syntaxhighlight>
In this on line x