Fullscreen Image

JavaScript

JavaScript is a programming language that works with HTML and CSS to make web pages dynamic. HTML gives structure and form to web page content, and CSS determines the look and feel of web page content. JavaScript is commonly mistaken for another programming language, Java. JavaScript differs from Java in that JavaScript must be used within a larger software structure—such as a web browser—whereas Java can be used to create software by itself—such as an app.

Your Accruent representative can help you implement JavaScript in Lucernex.

ClosedWhat is a programming language?

A programming language is a language that communicates instructions to a machine. A programming language is composed of three main components:

  1. Grammar — The grammar or syntax of the programming language dictates meaning through the order of words and commands. Just like we have verbs and nouns in language, we have objects and actions in programming languages.

  2. Punctuation — Punctuation is used to separate ideas. In English, we use periods to separate sentences. In JavaScript, we use semicolons.

  3. Vocabulary — Vocabulary in programming languages communicates intent. The vocabulary we use in JavaScript determines the outcome of our code.

Together, these components allow us to build statements, which are the sentences of a programming language.

ClosedWhere can I use JavaScript in Lucernex?

  • Manage Data Fields

    You can use JavaScript to populate fields with values that are generated using values from one or more fields. This method is useful when the script will always be applied and you do not need the field's value to be editable.

    Important!

    Your data field containing JavaScript must be on the same page as its source fields in order to execute the code.

  • Pages and Forms

    You can use JavaScript to populate fields with values that are generated using values from one or more fields on the page or form. This method is particularly useful when you want to pre-populate a field that should later be editable by the user.

  • Work Flows

    You can use JavaScript to make work flow approval actions appear only when certain conditions are met.

  • Reports

    You can use JavaScript to populate report values that are generated on demand using values from one or more fields, which may or may not appear in the report. Report values are temporary and are not stored in the database.

    Very large reports using complex scripts may take longer to run. If you experience issues that impact your work flow, contact Accruent Support.

    JavaScript usage in reports is restricted to fields, whereas Java is used for report filters. Understanding how to work with Java is beyond the scope of the Online Help. Please contact your Customer Success representative if you are interested in learning how to write or maintain report filters in Lucernex.

ClosedWhere can I learn more?

  • www.w3schools.com — W3 Schools: Great resource for beginners

  • Stack Overflow: Stack Overflow is a great resource for troubleshooting, but we recommend using Google to find relevant results on Stack Overflow.

  • http://jsbin.com/?html,js,output — JS Bin: Good tool for testing your scripts