Skip to content

Commit f47f893

Browse files
committed
Update Readme
1 parent 25be9e4 commit f47f893

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The button can be made available to users via a quick action powered by the `jsB
88

99
### The syntax
1010

11-
This is the fun part. The syntax is quite permissive, with some restrictions, which I will cover below. I haven't, obviously, explored all possible scenarios and the information may still be incomplete. Please raise a PR if you come across something I haven't covered.
11+
This is the fun part. The syntax is quite permissive, with some restrictions, which I will cover below. I haven't, obviously, explored all possible scenarios and the information may still be incomplete. Please raise an issue if you come across something I haven't covered.
1212

1313
* Simple examples (no soql/dml)
1414

@@ -25,8 +25,8 @@ alert(Array(5).fill(0).map((e,i)=>'Hello, '+i));
2525
```javascript
2626
let accts=|| Select Name,(Select Id from Contacts) from Account order by createddate desc limit 100 ||;
2727
let contacts = accts.filter((a)=>!a.Contacts || a.Contacts.length===0).slice(0,10).map((a)=>({LastName: a.Name+'-Contact', AccountId: a.Id}));
28-
let contactIds = || insert Contact(contacts) ||; //Note how the SObjectType has been specified. This is required for insert and upsert
29-
$A.get('e.force:refreshView').fire(); // $A is supported!
28+
let contactIds = || insert Contact(contacts) ||; /*Note how the SObjectType has been specified. This is required for insert and upsert*/
29+
$A.get('e.force:refreshView').fire(); /* $A is supported!*/
3030
```
3131

3232
* Act in the context of the current record
@@ -40,7 +40,20 @@ alert(acct[0].NumberOfEmployees);
4040
$A.get('e.force:refreshView').fire();
4141
```
4242

43+
### About the syntax
4344

45+
* Note how the syntax is linear for SOQL and DML. Coupled with JavaScript's support for manipulating arrays, this makes it easier to manipulate data, even compared to Apex in several instances.
46+
* SOQL and DML statements must be enclosed in `||`. Semi-colon can be inside or outside the `||`
47+
* Upsert and Update statements must be qualified with the SObjectType thus `|| insert Account(accts) ||;`
48+
* SOQL statements are parsed using template literals. Any arguments should follow the appropriate syntax `${argument}`
49+
* SOQL and DML statements may not be wrapped in a function.
50+
51+
### Known Limitations
52+
53+
* Single-line comments are not supported.
54+
* Haven't tested DML with date, datetime, boolean, geolocation and other compound fields. I will update this section as I do so.
55+
* Explicit use of async/await, Promises and Generators is not supported, atm.
56+
* DML on Files, Attachments, Documents, etc. is not supported
4457

4558
### Developers: Extending to more than one button per SObject Type
4659

0 commit comments

Comments
 (0)