Skip to content
Snippets Groups Projects
Commit d1e0c348 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '1068743_fix_multiple_participating' into '2021.0.0'

[Projekt: Entwicklung - xRM][TicketNr.: 1068743][Kontakt - Filterview  und...

See merge request xrm/basic!570
parents cdcafe82 841d79c8
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,7 @@
<element>PROCESS_SETVALUE</element>
<element>RECORD</element>
</onValueChangeTypes>
<onValidation>%aditoprj%/entity/CampaignAddParticipants_entity/entityfields/campaign_id/onValidation.js</onValidation>
</entityField>
<entityField>
<name>CAMPAIGNSTEP_ID</name>
......@@ -60,11 +61,6 @@
</entityConsumer>
<entityConsumer>
<name>CampaignStepConsumer</name>
<dependency>
<name>dependency</name>
<entityName>CampaignStep_entity</entityName>
<fieldName>CampaignSteps</fieldName>
</dependency>
<children>
<entityParameter>
<name>campaignId_param</name>
......@@ -72,6 +68,11 @@
<expose v="true" />
</entityParameter>
</children>
<dependency>
<name>dependency</name>
<entityName>CampaignStep_entity</entityName>
<fieldName>CampaignSteps</fieldName>
</dependency>
</entityConsumer>
<entityField>
<name>UID</name>
......
import("system.vars");
import("system.result");
import("Sql_lib");
import("system.translate");
let participants = JSON.parse(vars.get("$param.campaignParticipantsRowIds_param"));
if(participants.length > 0)
{
let thisParticipantCount = newSelect("count('')").from("CAMPAIGNPARTICIPANT")
.where("CAMPAIGNPARTICIPANT.CAMPAIGN_ID", vars.get("$field.CAMPAIGN_ID"))
.and(
"CAMPAIGNPARTICIPANT.CONTACT_ID",
participants,
SqlBuilder.IN()
).cell();
if(parseInt(thisParticipantCount) > 0)
result.string(translate.text("Participant is already participating"));
}
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