CRMScript improvements
Status: Solved
Description
We will implement a set of improvements to CRMScript:
- Arrays and struct already have .toJSON() and .fromXMLNode() methods, but these require either a JSONBuilder or an XMLNode. We will add two new functions, .toJSONString() and .fromJSONString() which will directly use a string as input or output.
- Arrays will get a .buildString() method similar to Vector, which will create a delimited string of its members. It will work by calling toString() on the members, which will make sense on an array of strings or integers, while an array of e.g. HTTP will return something like this: "[complex],[complex]".
- More types will get a toString() method. This will work together with the .buildString() function above, but will also as a bonus make variables of these types better to view in the debugger/tracer. Currently, a lot of these types will only show "[complex]".
- If a struct implements a method, "String toString()", then it will work with the pattern explained above.
- Error messages for incorrect array functions are now shown at the correct source position, but rather at the top of the document.
- Support for .sort() on arrays. Basic types will be sorted normally, such as Integers, strings or floats.
- Support for using a struct.compare(struct s) member function on an struct. If such a method exists, it should be used to sort an array of that struct.
Details
| Issue id | 28140 |
| Registered | 4 May 2022 |
| Last modified | 2 Aug 2022 |
| Severity |
| Area | Service |
| Status | Solved |
| Target release | CRM Online 10.1.4 |
| Released date | 14 Jun 2022 |
| Type | Feature |