Skip to content
Snippets Groups Projects
Commit 167838b2 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

#1045399 360° add campaign: same same function as for all other add campaigns....

#1045399 360° add campaign: same same function as for all other add campaigns. -> Better  validation if the contact can be added to the campaign
parent de6aec7e
No related branches found
No related tags found
No related merge requests found
import("system.vars");
import("Campaign_lib");
CampaignUtils.addParticipant(vars.getString("$param.ObjectRowId_param"));
\ No newline at end of file
if (vars.get("$param.BaseContextId_param") == "Person" || vars.get("$param.BaseContextId_param") == "Organisation")
{
// Note: this only works if the BaseContextId_param is also the correct Tablename. If not you have to add a context - tablename mapping somewhere...
// for person / organisation this should work
CampaignUtils.addParticipantsByRowIds(JSON.stringify([vars.getString("$param.ObjectRowId_param")]), vars.get("$param.BaseContextId_param").toUpperCase());
}
\ No newline at end of file
......@@ -15,20 +15,10 @@ import("Neon_lib");
*/
function CampaignUtils() {}
/**
* Add one Contact (Person or Organistaion) to a Campaign
*
* @param {String} pContactId req ContactId
*/
CampaignUtils.addParticipant = function(pContactId)
{
_CampaignUtils._openAddParticipantContext("CampaignParticipant", pContactId, "ContactId_param", "CampaignParticipantEdit_view");
}
/**
* Add many Contacts (Person or Organistaion) to a Campaign
*
* @param {String} pRowIds req ContactIds
* @param {String} pRowIds ContactIds as JSON array
* @param {String} pSourceTableName req
*/
CampaignUtils.addParticipantsByRowIds = function(pRowIds, pSourceTableName)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment