Skip to content
Snippets Groups Projects
Commit d370beda authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch 'm_mg_1080101_campaignparticipant_duplicate_entries' into '2021.1.0'

campaignparticipant duplicate entries

See merge request xrm/basic!1025
parents 5564a52a 64ad9849
No related branches found
No related tags found
No related merge requests found
......@@ -188,6 +188,7 @@
<name>ExcludeCommunicationRejecting_param</name>
<valueProcess>%aditoprj%/entity/BulkMailRecipient_entity/entityfields/recipientstobemailed/children/excludecommunicationrejecting_param/valueProcess.js</valueProcess>
<expose v="false" />
<title></title>
</entityParameter>
</children>
</entityProvider>
......
......@@ -11,7 +11,7 @@ var maxCount = vars.get("$field.campaignStepMaxParticipantCount");
var isUpdate = Utils.toBoolean(vars.get("$param.isUpdate_param"));
if (vars.get("$field.CAMPAIGN_ID")){
var currentCount = CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"),vars.get("$field.CAMPAIGN_ID"));
var currentCount = parseInt(CampaignUtils.getParticipantCountForStep(vars.get("$field.CAMPAIGNSTEP_ID"),vars.get("$field.CAMPAIGN_ID")));
if ( (validCount+currentCount) > maxCount)
result.string(translate.text("Not enough room in campaignstep"));
......
......@@ -103,6 +103,7 @@
<state>READONLY</state>
<stateProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/stateProcess.js</stateProcess>
<displayValueProcess>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/CampaignParticipant_entity/entityfields/contact_id/onValidation.js</onValidation>
</entityField>
<entityField>
<name>DATE_NEW</name>
......
import("system.translate");
import("system.result");
import("system.neon");
import("system.vars");
import("Sql_lib");
if (vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW && vars.get("$local.value") && vars.get("$field.CAMPAIGN_ID"))
{
var isParticipant= newSelect(["CONTACT_ID"])
.from("CAMPAIGNPARTICIPANT")
.where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", vars.get("$field.CAMPAIGN_ID"))
.and("CAMPAIGNPARTICIPANT.CONTACT_ID",vars.get("$local.value"))
.cell();
if (isParticipant){
result.string(translate.text("Chosen record is already in the campaign"));
}
}
\ No newline at end of file
......@@ -2,7 +2,7 @@ import("system.result");
import("system.neon");
import("system.vars");
if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param"))
if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param") || vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_EDIT)
//A contact has been provided. Show it in readonly.
fieldState = neon.COMPONENTSTATE_READONLY;
else
......
......@@ -435,6 +435,10 @@
<key>Claim task</key>
<value>Aufgabe annehmen</value>
</entry>
<entry>
<key>Chosen record is already in the campaign</key>
<value>Ausgewählter Datensatz befindet sich bereits in der Kampagne</value>
</entry>
<entry>
<key>Finished tasks</key>
<value>Abgeschlossene Aufgaben</value>
......
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