GlideForm provides getter and setter methods that provide access to the record as it is displayed on the screen. Let's run some code in the JavaScript executor in order to understand what options are available.
- Navigate to a new Check-in record (Hotel > Check-ins, then press New). Populate the form as follows, but you don't need to save.
- Room: 301 (you may need to create it)
- The aim is to ensure the floor field is populated. Once done, press Ctrl + Shift + J to launch the JavaScript Executor.
- Use the following code, then click on Run:
var floor = g_form.getValue('room.floor'); if (floor > 2) { g_form.showFieldMsg('room.floor', 'This is a high floor!'); g_form.setDisplay('comments', true); g_form.setValue('comments', ...