You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
7. Installer [AdoptOpenJDK](https://adoptopenjdk.net) (kun versjon 8 eller 11)
@@ -42,9 +40,9 @@ Utvikling foregår i hovedsak på to fronter, i nettleseren i din scratch org og
42
40
43
41
Ved å bruke VS Code som IDE, er det lagt inn konfigurasjon som automatisk pusher endringer av metadata til din scratch org ved lagring. For å pulle endringer fra kan man enten bruke Salesforce DX CLI til å pulle, men også pushe om man ikke ønsker automatisk push. Se under for kommandoer. Man kan også bruke hjelpeverktøyet SSDX (nevnt over) for å pushe, pulle, åpne scratch org-er, slette gamle, blant annet.
44
42
45
-
*`sfdx force:org:open` for å åpne instansen(salesforce applikasjonen din).
46
-
*`sfdx force:source:pull` for å hente endringer som du gjør i konfigurasjon i applikasjonen online.
47
-
*`sfdx force:source:push` for å publisere endringer du gjør i kode lokalt til applikasjonen online.
43
+
-`sfdx force:org:open` for å åpne instansen(salesforce applikasjonen din).
44
+
-`sfdx force:source:pull` for å hente endringer som du gjør i konfigurasjon i applikasjonen online.
45
+
-`sfdx force:source:push` for å publisere endringer du gjør i kode lokalt til applikasjonen online.
Always add `RecordType.DeveloperName` to your SOQL query when exporting, if you want to keep the record type intact. A plugin is fixing the record type ID before it is imported to the new scratch org, so you won't have to do a single thing.
5
6
6
7
## Exporting data from an org
@@ -15,34 +16,29 @@ Use a name for the feature this data is suitable for, OR the name of the object.
15
16
16
17
Sometimes, you'll need to export from the child with numerous parents (many lookups).
You'll then ***rename***`dummy-data/[name]/[Child sObject]s-plan.json` to __ONLY be plan.json__ (in the same folder). Then edit the file, and make sure each json file containing data is present in the plan. The plan.json file is the plan for what is imported.
You'll then **_rename_**`dummy-data/[name]/[Child sObject]s-plan.json` to **ONLY be plan.json** (in the same folder). Then edit the file, and make sure each json file containing data is present in the plan. The plan.json file is the plan for what is imported.
27
27
28
28
```json
29
29
[
30
-
{
31
-
"sobject": "[Parent sObject]",
32
-
"saveRefs": true,
33
-
"resolveRefs": false,
34
-
"files": [
35
-
"[Parent sObject]s.json"
36
-
]
37
-
},
38
-
{
39
-
"sobject": "[Child sObject]",
40
-
"saveRefs": false,
41
-
"resolveRefs": true,
42
-
"files": [
43
-
"[Child sObject]s.json"
44
-
]
45
-
}
30
+
{
31
+
"sobject": "[Parent sObject]",
32
+
"saveRefs": true,
33
+
"resolveRefs": false,
34
+
"files": ["[Parent sObject]s.json"]
35
+
},
36
+
{
37
+
"sobject": "[Child sObject]",
38
+
"saveRefs": false,
39
+
"resolveRefs": true,
40
+
"files": ["[Child sObject]s.json"]
41
+
}
46
42
]
47
43
```
48
44
@@ -54,66 +50,64 @@ Example `myFeature-plan.json`:
54
50
55
51
```json
56
52
[
57
-
{
58
-
"sobject": "Account",
59
-
"saveRefs": true,
60
-
"resolveRefs": false,
61
-
"files": [
62
-
"myFeature-Accounts.json"
63
-
]
64
-
},
65
-
{
66
-
"sobject": "Case",
67
-
"saveRefs": false,
68
-
"resolveRefs": true,
69
-
"files": [
70
-
"myFeature-Cases.json"
71
-
]
72
-
}
53
+
{
54
+
"sobject": "Account",
55
+
"saveRefs": true,
56
+
"resolveRefs": false,
57
+
"files": ["myFeature-Accounts.json"]
58
+
},
59
+
{
60
+
"sobject": "Case",
61
+
"saveRefs": false,
62
+
"resolveRefs": true,
63
+
"files": ["myFeature-Cases.json"]
64
+
}
73
65
]
74
66
```
75
67
76
68
Example `myFeature-Accounts.json`:
77
69
78
70
```json
79
71
{
80
-
"records": [
81
-
{
82
-
"attributes": {
83
-
"type": "Account",
84
-
"referenceId": "AccountRef1"
85
-
},
86
-
"BillingState": "Wyoming",
87
-
"ShippingState": "Wyoming",
88
-
"BillingCity": "Cheyenne",
89
-
"ShippingCity": "Cheyenne",
90
-
"Name": "Yadel"
91
-
},
92
-
]
72
+
"records": [
73
+
{
74
+
"attributes": {
75
+
"type": "Account",
76
+
"referenceId": "AccountRef1"
77
+
},
78
+
"BillingState": "Wyoming",
79
+
"ShippingState": "Wyoming",
80
+
"BillingCity": "Cheyenne",
81
+
"ShippingCity": "Cheyenne",
82
+
"Name": "Yadel"
83
+
}
84
+
]
93
85
}
94
86
```
95
87
96
88
Example `myFeature-Cases.json`:
97
89
98
90
```json
99
91
{
100
-
"records": [
101
-
{
102
-
"attributes": {
103
-
"type": "Case",
104
-
"referenceId": "CaseRef1"
105
-
},
106
-
"Account": "@AccountRef1",
107
-
"Name": "My first case"
108
-
},
109
-
]
92
+
"records": [
93
+
{
94
+
"attributes": {
95
+
"type": "Case",
96
+
"referenceId": "CaseRef1"
97
+
},
98
+
"Account": "@AccountRef1",
99
+
"Name": "My first case"
100
+
}
101
+
]
110
102
}
111
103
```
112
104
113
105
## File and folder structure
106
+
114
107
**ALWAYS** have dummy-data self-contained in its own folder, both for readability and avoiding overwriting existing data. If you want ALL scratch orgs to have your dummy data, add the data as `dummy-data/[name]/`, which contains ONE `plan.json` file and one or more `[sObjects].json` files, which are also referenced in the plan.sjon.
115
108
116
109
The init scripts for scratch org creation automatically find these `plan.sjon` files and imports them for you. If you don't want auto importing, have the `plan.sjon` file renamed to anything else, and it won't be imported.
117
110
118
111
## Importing dummy data
119
-
All data is automatically imported using the init scripts for macOS or Windows, as long as they follow the folder structures defined above. See `./scripts/mac/createScratchOrg.command` and `./scripts/windows/createScratchOrg.sh`.
112
+
113
+
All data is automatically imported using the init scripts for macOS or Windows, as long as they follow the folder structures defined above. See `./scripts/mac/createScratchOrg.command` and `./scripts/windows/createScratchOrg.sh`.
0 commit comments