I have a roads
table:
+---------+---------+
| ROAD_ID | MEASURE |
+---------+---------+
| 1 | 1000 |
| 2 | 100 |
| 3 | 500 |
| 4 | 9000 |
+---------+---------+
And I have a related linear referencing table called projects
:
+------------+---------+--------------+------------+
| PROJECT_ID | ROAD_ID | FROM_MEASURE | TO_MEASURE |
+------------+---------+--------------+------------+
| 101 | 1 | 0 | 50 |
| 102 | 1 | 100 | 500 |
+------------+---------+--------------+------------+
| 103 | 2 | 0 | 100 |
+------------+---------+--------------+------------+
| 104 | 3 | 100 | 200 |
| 105 | 3 | 400 | 500 |
+------------+---------+--------------+------------+
Users manually enter projects into application's attribute editing environment (more here).
The workflow for entering new projects is:
- The user creates a blank new record.
- The
FROM_MEASURE
has a default value of0
. - The user enters the
ROAD_ID
manually. - The user enters the
TO_MEASURE
manually.
You can't tell from the sample table, but 9 times out of 10, projects pertain to an entire road (not just a portion of the road). An example is PROJECT #103
.
Rather than make the user manually enter the TO_MEASURE
when imputing new projects, would it be possible to get these values automatically once the ROAD_ID
is entered?
Example:
The user creates a blank new record.
The
FROM_MEASURE
has a default value of0
.
+------------+---------+--------------+------------+
| PROJECT_ID | ROAD_ID | FROM_MEASURE | TO_MEASURE |
+------------+---------+--------------+------------+
| 106 | | 0 | |
+------------+---------+--------------+------------+
The user enters the
ROAD_ID
manually.The
TO_MEASURE
is automatically retrieved:
+------------+---------+--------------+------------+
| PROJECT_ID | ROAD_ID | FROM_MEASURE | TO_MEASURE |
+------------+---------+--------------+------------+
| 106 | 4 | 0 | 9000 | <-- Magic!
+------------+---------+--------------+------------+
After ROAD_ID is updated, automatically get the related road's MEASURE value as the TO_MEASURE
.