Code snippets in the Script Editor
You write your script in the Script editing pane. You can write code from scratch or import existing snippets.
| You can create your own custom Code Snippet |
Procedure
-
Right-click on the Script editing pane and select Code Snippets.
Make sure your script is in editing mode. There should be an open-lock-symbol next to your script in the Application component pane.
Result: The code snippets dialog opens.
-
Browse or search for a code snippet in the menu on the left.
-
Select the snippet to see the full code.
-
Select Copy to paste the code in your Script editing pane. The dialog closes automatically.
Types of code snippets
Neptune DXP - Open Edition provide a wide range of code snippets on your disposal. Here are some categories:
- Adaptive Designer
-
Boilerplate code snippets for returning data from a script to the Adaptive Designer for adaptive framework process, including:
-
setting the options of a
SingleSelectofMultiSelectlist -
setting a field’s default value
-
- Basic JavaScript
-
Basic JavaScript code snippets are simple examples that illustrate the fundamental concepts and syntax of the JavaScript programming language. They are typically used to demonstrate core functionalities.
- Custom
-
Custom code snippets. Check Code Snippets for more details.
- Generated
-
Code snippets generated according to your resources that are included in your script.