Skip to content

Commit f9e64d3

Browse files
authored
Update README.md
1 parent b37e4a2 commit f9e64d3

File tree

1 file changed

+68
-3
lines changed

1 file changed

+68
-3
lines changed

README.md

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ Using XTL provides the following benefits:
8686
Native Types:
8787
- String Constants (Alpha numeric text inside quotes)
8888
- Integers (Digit expression)
89+
- Doubles (Digits are separated by '.', a 'd' is appended to separate from decimals. E.g: 1.4d)
90+
- Decimals (Digits are separated by '.', a 'm' is appended to separate from doubles. E.g: 1.4m)
8991
- Booleans (true or false)
9092
- Functions (Identifiers without quotes followed by parenthesis with parameters)
93+
- Dictionaries (JS style objects, such as { propertyName: value }. Value can be a constant or another expression.
9194

9295
In addition, null is also a reserved keyword.
9396

@@ -145,11 +148,43 @@ Example:
145148
IsEqual ( Value ( "gendercode" ), 1 )
146149
```
147150

151+
### IsLess
152+
Checks if first parameter is less than the second. If yes, true is returned, otherwise false.
153+
154+
Example:
155+
```
156+
IsLess ( 1, 2 )
157+
```
158+
159+
### IsLessEqual
160+
Checks if first parameter is less or equal than the second. If yes, true is returned, otherwise false.
161+
162+
Example:
163+
```
164+
IsLessEqual ( 1, 2 )
165+
```
166+
167+
### IsGreater
168+
Checks if first parameter is greater than the second. If yes, true is returned, otherwise false.
169+
170+
Example:
171+
```
172+
IsGreater ( 1, 2 )
173+
```
174+
175+
### IsGreaterEqual
176+
Checks if first parameter is greater or equal than the second. If yes, true is returned, otherwise false.
177+
178+
Example:
179+
```
180+
IsGreaterEqual ( 1, 2 )
181+
```
182+
148183
### Value
149184
Returns the object value of the given property. If it is used as top level function, the matching string representation is returned.
150185
The text function which was present in early releases was replaced by this, as the Value function hosts both the string representation and the actual value now.
151186
You can jump to entities that are connected by a lookup by concatenating field names with a '.' as separator.
152-
Default base entity for all operations is the primary entity. You can override this behaviour by passing an entity object as second parameter.
187+
Default base entity for all operations is the primary entity. You can override this behaviour by passing an entity object as config parameter named `explicitTarget`, like so: `Value("regardingobjectid.firstname", PrimaryRecord())`.
153188

154189
Example:
155190
```
@@ -211,16 +246,20 @@ Last ( Fetch ( "<fetch no-lock='true'><entity name='task'><attribute name='descr
211246
### RecordTable
212247
Returns a table of records with specified columns and record url if wanted.
213248
First parameter is a list of records, for displaying inside the table. Consider retrieving them using the Fetch function.
214-
Second is the name of the sub entity, third whether to include URL or not.
249+
Second is the name of the sub entity.
215250
Third is an array expression containing the columns to retrieve, which will be added in the same order.
216251
By default the columns are named like the display names of their respective CRM columns. If you want to override that, append a colon and the text you want to use, such as "subject:Overridden Subject Label".
217252

253+
If you wish to append the record url as last column, pass a configuration object as last parameter as follows: `{ addRecordUrl: true }`.
254+
There is also the possibility to configure table, header and row styling. Pass a style property inside your configuration parameter, as follows: `{ tableStyle: "border:1px solid green;", headerStyle: "border:1px solid orange;", dataStyle: "border:1px solid red;"}`.
255+
Only pass one configuration object, it can contain information on addRecordUrl as well as on table styling.
256+
218257
Below you can find an example, which executes on e-mail creation and searches for tasks associated to the mails regarding contact.
219258
It will then print the task subject and description, including an url, into the mail.
220259

221260
Example:
222261
```
223-
RecordTable ( Fetch ( "<fetch no-lock='true'><entity name='task'><attribute name='description' /><attribute name='subject' /><filter><condition attribute='regardingobjectid' operator='eq' value='{1}' /></filter></entity></fetch>", Value ( "regardingobjectid" ) ), "task", true, Array( "subject:Overridden Subject Label", "description" ))
262+
RecordTable ( Fetch ( "<fetch no-lock='true'><entity name='task'><attribute name='description' /><attribute name='subject' /><filter><condition attribute='regardingobjectid' operator='eq' value='{1}' /></filter></entity></fetch>", Value ( "regardingobjectid" ) ), "task", Array( "subject:Overridden Subject Label", "description" ), { addRecordUrl: true })
224263
```
225264

226265
### PrimaryRecord
@@ -289,6 +328,32 @@ NewLine()
289328
```
290329
Info: This is needed when wanting to concatenate multiple texts using concat or join, since passing "\n" as .NET line break string is interpreted as plain string.
291330

331+
### DateTimeNow
332+
Gets the current local time.
333+
334+
Example:
335+
```
336+
DateTimeNow()
337+
```
338+
339+
### DateTimeUtcNow
340+
Gets the current UTC time.
341+
342+
Example:
343+
```
344+
DateTimeUtcNow()
345+
```
346+
347+
### DateToString
348+
Prints the date that is passed as first parameter. A custom format can be appended using a configuration object with format key.
349+
350+
Example:
351+
```
352+
DateToString(DateTimeUtcNow(), { format: \"yyyyMMdd\" })
353+
```
354+
355+
Refer to the .NET style for date formatting.
356+
292357
## Sample
293358
Consider the following e-mail template content:
294359
```

0 commit comments

Comments
 (0)