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
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ JS buttons are back in Lightning! For now, at least. And they are even more powe
6
6
7
7
The button can be made available to users via a quick action powered by the `jsButtonQuickAction` component. The actual JavaScript should be entered into a `JS_Button__mdt` custom metadata record, into the `Script__c` field with the same name as the name of the SObject. The repo contains a couple of samples for Account and Contact. The corollary is that, out of the box, only one button per SObjecttype may be supported.
8
8
9
-
### The syntax
9
+
### The Syntax
10
10
11
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.
* 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
46
* SOQL and DML statements must be enclosed in `||`. Semi-colon can be inside or outside the `||`
* Support for delete has been intentionally withheld.
53
54
* Single-line comments are not supported.
54
55
* Haven't tested DML with date, datetime, boolean, geolocation and other compound fields. I will update this section as I do so.
55
56
* Explicit use of async/await, Promises and Generators is not supported, atm.
56
57
* DML on Files, Attachments, Documents, etc. is not supported
57
58
58
-
### Developers: Extending to more than one button per SObject Type
59
+
### For Developers: Extending to more than one Button per SObjectType
59
60
60
-
If you need more, you may create lightning component quickActions with the name of the custom metadata record containing your JS passed in to the `jsButton` child component. You will also need to implement an `init` method to invoke the controller method in `jsButton`. Refer to the `jsButtonQuickAction` component for more details
61
+
If you need more than one button on an SObjectType, you may create a lightning component quickAction with the name of the custom metadata record containing your JS passed in to the `jsButton` child component. You will also need to implement an `init` method to invoke the controller method in `jsButton`. Refer to the `jsButtonQuickAction` component for implementation details
0 commit comments