Difference between revisions of "Post Selection JavaScript"
From AgileApps Support Wiki
imported>Aeric |
imported>Aeric |
||
Line 2: | Line 2: | ||
:''Compare to [[Form Scripting]] and [[Field Scripting]]'' | :''Compare to [[Form Scripting]] and [[Field Scripting]]'' | ||
=== Editing Lookup Scripts === | === Editing Lookup Scripts === | ||
Follow these steps to add or change scripting for a | Follow these steps to add or change scripting for a Lookup field: | ||
# Click '''[[File:GearIcon.png]] > Customization > Objects > {object} > Fields''' | # Click '''[[File:GearIcon.png]] > Customization > Objects > {object} > Fields''' |
Revision as of 22:49, 21 May 2014
Lookup fields have the additional ability for validations using JavaScript.
- Compare to Form Scripting and Field Scripting
Editing Lookup Scripts
Follow these steps to add or change scripting for a Lookup field:
- Click > Customization > Objects > {object} > Fields
- Click the name of the Lookup field.
- Enter or change the code in Post Selection JavaScript.
- Click the Save button.
Writing Lookup Scripts
In the JavaScript code, the following variables are available:
- objectId The identifier for the Object
- id: The identifier of the selected record
- name: The label of the selected record
This example displays the label of the selected record.
alert("You have selected record: " + name);
Learn More
- Field Name and Field Value syntax
- Use AJAX and REST to communicate with the platform in JavaScript code.
- Global JavaScript Variables
- Accessing Additional Lookup Variables in a Form