Skip to content

Commit 237881a

Browse files
authored
Merge pull request #347 from navikt/Kansellert_Kurs_Flow_Fix
CourseCancellation flow fix and added mac script for creating sc org
2 parents d6d68fd + c6118d4 commit 237881a

File tree

2 files changed

+142
-40
lines changed

2 files changed

+142
-40
lines changed

force-app/main/default/flows/HOT_CourseCancellationEmail.flow-meta.xml

+85-40
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,66 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Flow xmlns="http://soap.sforce.com/2006/04/metadata">
33
<apiVersion>60.0</apiVersion>
4+
<assignments>
5+
<name>Legg_til_email_i_collection</name>
6+
<label>Legg til email i collection</label>
7+
<locationX>264</locationX>
8+
<locationY>647</locationY>
9+
<assignmentItems>
10+
<assignToReference>emails</assignToReference>
11+
<operator>Add</operator>
12+
<value>
13+
<elementReference>email</elementReference>
14+
</value>
15+
</assignmentItems>
16+
<connector>
17+
<targetReference>Send_email_to_all_participants_loop</targetReference>
18+
</connector>
19+
</assignments>
20+
<assignments>
21+
<name>Opprett_email</name>
22+
<label>Opprett email</label>
23+
<locationX>264</locationX>
24+
<locationY>539</locationY>
25+
<assignmentItems>
26+
<assignToReference>email.SaveAsActivity__c</assignToReference>
27+
<operator>Assign</operator>
28+
<value>
29+
<booleanValue>true</booleanValue>
30+
</value>
31+
</assignmentItems>
32+
<assignmentItems>
33+
<assignToReference>email.Status__c</assignToReference>
34+
<operator>Assign</operator>
35+
<value>
36+
<stringValue>Instant</stringValue>
37+
</value>
38+
</assignmentItems>
39+
<assignmentItems>
40+
<assignToReference>email.TargetObjectId__c</assignToReference>
41+
<operator>Assign</operator>
42+
<value>
43+
<elementReference>Send_email_to_all_participants_loop.CourseParticipant__c</elementReference>
44+
</value>
45+
</assignmentItems>
46+
<assignmentItems>
47+
<assignToReference>email.TemplateName__c</assignToReference>
48+
<operator>Assign</operator>
49+
<value>
50+
<stringValue>courseCancellation</stringValue>
51+
</value>
52+
</assignmentItems>
53+
<assignmentItems>
54+
<assignToReference>email.WhatId__c</assignToReference>
55+
<operator>Assign</operator>
56+
<value>
57+
<elementReference>Send_email_to_all_participants_loop.Id</elementReference>
58+
</value>
59+
</assignmentItems>
60+
<connector>
61+
<targetReference>Legg_til_email_i_collection</targetReference>
62+
</connector>
63+
</assignments>
464
<description>Sends emails to participants when course is cancelled</description>
565
<environments>Default</environments>
666
<interviewLabel>Course Cancellation email {!$Flow.CurrentDateTime}</interviewLabel>
@@ -13,8 +73,11 @@
1373
<collectionReference>Get_all_participants</collectionReference>
1474
<iterationOrder>Asc</iterationOrder>
1575
<nextValueConnector>
16-
<targetReference>Create_emails</targetReference>
76+
<targetReference>Opprett_email</targetReference>
1777
</nextValueConnector>
78+
<noMoreValuesConnector>
79+
<targetReference>Create_Records1</targetReference>
80+
</noMoreValuesConnector>
1881
</loops>
1982
<processMetadataValues>
2083
<name>BuilderType</name>
@@ -36,45 +99,11 @@
3699
</processMetadataValues>
37100
<processType>AutoLaunchedFlow</processType>
38101
<recordCreates>
39-
<name>Create_emails</name>
40-
<label>Create emails</label>
41-
<locationX>264</locationX>
42-
<locationY>539</locationY>
43-
<connector>
44-
<targetReference>Send_email_to_all_participants_loop</targetReference>
45-
</connector>
46-
<inputAssignments>
47-
<field>SaveAsActivity__c</field>
48-
<value>
49-
<booleanValue>true</booleanValue>
50-
</value>
51-
</inputAssignments>
52-
<inputAssignments>
53-
<field>Status__c</field>
54-
<value>
55-
<stringValue>Instant</stringValue>
56-
</value>
57-
</inputAssignments>
58-
<inputAssignments>
59-
<field>TargetObjectId__c</field>
60-
<value>
61-
<elementReference>Send_email_to_all_participants_loop.CourseParticipant__c</elementReference>
62-
</value>
63-
</inputAssignments>
64-
<inputAssignments>
65-
<field>TemplateName__c</field>
66-
<value>
67-
<stringValue>courseCancellation</stringValue>
68-
</value>
69-
</inputAssignments>
70-
<inputAssignments>
71-
<field>WhatId__c</field>
72-
<value>
73-
<elementReference>Send_email_to_all_participants_loop.Id</elementReference>
74-
</value>
75-
</inputAssignments>
76-
<object>EmailQueue__c</object>
77-
<storeOutputAutomatically>true</storeOutputAutomatically>
102+
<name>Create_Records1</name>
103+
<label>Create Records</label>
104+
<locationX>176</locationX>
105+
<locationY>839</locationY>
106+
<inputReference>emails</inputReference>
78107
</recordCreates>
79108
<recordLookups>
80109
<name>Get_all_participants</name>
@@ -124,4 +153,20 @@
124153
<triggerType>RecordAfterSave</triggerType>
125154
</start>
126155
<status>Active</status>
156+
<variables>
157+
<name>email</name>
158+
<dataType>SObject</dataType>
159+
<isCollection>false</isCollection>
160+
<isInput>false</isInput>
161+
<isOutput>false</isOutput>
162+
<objectType>EmailQueue__c</objectType>
163+
</variables>
164+
<variables>
165+
<name>emails</name>
166+
<dataType>SObject</dataType>
167+
<isCollection>true</isCollection>
168+
<isInput>false</isInput>
169+
<isOutput>false</isOutput>
170+
<objectType>EmailQueue__c</objectType>
171+
</variables>
127172
</Flow>

scripts/bat/newScratchOrgMac.sh

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
3+
echo "Oppretter scratch org"
4+
sf org create scratch --definition-file config/project-scratch-def.json --alias "$1" --duration-days "$2" --set-default --json --wait 30
5+
6+
echo "Installerer crm-platform-base ver. 0.218"
7+
sf package install --package 04t7U000000Y3esQAC --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
8+
9+
echo "Installerer crm-platform-access-control ver. 0.125"
10+
sf package install --package 04t7U000000Y3V7QAK --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
11+
12+
echo "Installerer crm-platform-reporting ver. 0.37"
13+
sf package install --package 04t7U000000Y2VoQAK --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
14+
15+
echo "Installerer crm-shared-base ver. 1.1"
16+
sf package install --package 04t2o000000ySqpAAE --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
17+
18+
echo "Installerer crm-thread-view ver. 0.2"
19+
sf package install --package 04t7U000000TqvIQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
20+
21+
echo "Installerer crm-shared-timeline ver. 1.22"
22+
sf package install --package 04t7U000000Y2OEQA0 --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
23+
24+
echo "Installerer crm-shared-flowComponents ver. 0.4"
25+
sf package install --package 04t7U0000008qz4QAA --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
26+
27+
echo "Installerer crm-henvendelse-base ver. 0.18"
28+
sf package install --package 04t7U000000LPPAQA4 --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
29+
30+
echo "Installerer crm-platform-integration ver. 0.110"
31+
sf package install --package 04t7U000000Y3pWQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
32+
33+
echo "Installerer crm-journal-utilities ver. 0.28"
34+
sf package install --package 04t7U000000Y3iGQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
35+
36+
echo "Installerer crm-platform-oppgave ver. 0.53"
37+
sf package install --package 04t7U000000Y3r3QAC --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
38+
39+
echo "Installerer crm-arbeidsgiver-base ver. 1.411"
40+
sf package install --package 04t7U000000Y3qFQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
41+
42+
echo "Installerer crm-community-base ver. 0.102"
43+
sf package install --package 04t7U000000Y3eTQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
44+
45+
echo "Installerer crm-platform-email-scheduling ver. 1.7"
46+
sf package install --package 04t7U000000Y2bXQAS --no-prompt --installation-key "$3" --wait 30 --publish-wait 30
47+
48+
echo "Dytter kildekoden til scratch org'en"
49+
sf project deploy start
50+
51+
echo "Tildeler tilatelsessett til brukeren"
52+
sf org assign permset --name Kurs_Salesforce_Admin
53+
54+
echo "Publish Experience Site"
55+
sf community publish --name Kurs1
56+
57+
echo "Ferdig"

0 commit comments

Comments
 (0)