Triggers: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 641: Line 641:
<br/>
<br/>


== Built-in Objects Examples ==
=== Built-in Objects Examples ===


=== Example: Extracting components from a Contact field into separate fields ===
==== Example: Extracting components from a Contact field into separate fields ====
Suppose you have a Contact field called myContact. If you would like the name, primary phone, and primary email as separate fields, create the fields, maybe ContactFullname, ContactPrimaryPhone, and ContactPrimaryEmail. The create two triggers, as follows:
Suppose you have a Contact field called myContact. If you would like the name, primary phone, and primary email as separate fields, create the fields, maybe ContactFullname, ContactPrimaryPhone, and ContactPrimaryEmail. The create two triggers, as follows:


Line 666: Line 666:
Now, every time you create a new entry or update an existing one, the contact information will be extracted to separate fields.
Now, every time you create a new entry or update an existing one, the contact information will be extracted to separate fields.


=== Example: Extracting coordinates from a Location field into Real fields ===
==== Example: Extracting coordinates from a Location field into Real fields ====
Suppose you have a Location field called myLocation. If you would like the coordinates as Real fields, create the Real fields, maybe LocationLatitude and LocationLongitude. The create two triggers, as follows:
Suppose you have a Location field called myLocation. If you would like the coordinates as Real fields, create the Real fields, maybe LocationLatitude and LocationLongitude. The create two triggers, as follows: