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
Copy file name to clipboardExpand all lines: README.md
+56Lines changed: 56 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ A domain specific language for Dynamics CRM allowing for easy text template proc
24
24
-[And](#and)
25
25
-[Not](#not)
26
26
-[IsNull](#isnull)
27
+
-[Coalesce](#coalesce)
28
+
-[Case](#case)
27
29
-[IsEqual](#isequal)
28
30
-[IsLess](#isless)
29
31
-[IsLessEqual](#islessequal)
@@ -36,6 +38,7 @@ A domain specific language for Dynamics CRM allowing for easy text template proc
36
38
-[Last](#last)
37
39
-[Union](#union)
38
40
-[Map](#map)
41
+
-[Filter](#filter)
39
42
-[Sort](#sort)
40
43
-[RecordTable](#recordtable)
41
44
-[PrimaryRecord](#primaryrecord)
@@ -197,6 +200,39 @@ Example:
197
200
IsNull( Value ("parentaccountid") )
198
201
```
199
202
203
+
### Coalesce
204
+
**Available since: v3.9.6**
205
+
206
+
Uses the first non-null value of all parameters passed.
207
+
208
+
Example:
209
+
```JavaScript
210
+
Coalesce ( Value ( "parentaccountid" ), Value ( "parentcontactid" ), "None" )
211
+
```
212
+
213
+
If parentaccountid is not null, it will be used.
214
+
Otherwise, if parentcontactid is not null, it will be used.
215
+
If none of these two are not null, the static "None" will be used.
216
+
217
+
### Case
218
+
**Available since: v3.9.6**
219
+
220
+
Checks a list of conditions followed by their values and uses the first true condition's value as result.
221
+
If none matches, the last value is used as default result.
222
+
223
+
Because of this, the list of parameters has to be odd ( 2 * n + 1, where n is the number of conditions, where each condition has one check followed by one result plus the last value as default).
224
+
225
+
Example:
226
+
```JavaScript
227
+
Case ( IsLess ( Value ("creditlimit"), 1000 ), "Low", IsLess ( Value ("creditlimit"), 50000 ), "Medium", IsLess ( Value ("credilimit"), 100000 ), "High", "None" )
228
+
```
229
+
230
+
In above example, if credit limit is below 1000, it will return "Low".
231
+
Otherwise, if it is less than 50.000, it will return "Medium".
232
+
Otherwise, if it is less than 100.000, it will return "High".
233
+
234
+
If none matches, for example if creditlimit is null, it will return "None".
235
+
200
236
### IsEqual
201
237
Checks if two parameters are equal. If yes, true is returned, otherwise false.
202
238
The parameters are required to be of the same type.
@@ -365,6 +401,26 @@ Join(", ", Map(Fetch("<fetch no-lock='true'><entity name='contact'><attribute na
365
401
```
366
402
367
403
will result in something like this: `"2018-10-27 05:39, 2019-04-24 10:24"`
404
+
405
+
### Filter
406
+
**Available since: v3.9.6**
407
+
Filters values inside an array by checking every value using the provided function.
408
+
If the provided function returns true, the value will be kept, otherwise it will be filtered out.
0 commit comments