File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ module default {
3
3
overloaded name {
4
4
constraint exclusive ;
5
5
}
6
-
6
+
7
7
required accountNumber: int16 {
8
8
constraint min_value (0 );
9
9
constraint max_value (9 );
Original file line number Diff line number Diff line change @@ -44,9 +44,17 @@ module default {
44
44
# multi link engagements := .<project[is Engagement];
45
45
property engagementTotal := count (.< project[is Engagement]);
46
46
47
- # link primaryLocation: Location;
48
- # link marketingLocation: Location;
49
- # link fieldRegion: FieldRegion;
47
+ primaryLocation: Location;
48
+ trigger enforceFundingAccount after update for each do (
49
+ assert (
50
+ any (__new__ .primaryLocation.fundingAccount.accountNumber > 0 )
51
+ or not exists __new__ .primaryLocation, # allow clearing
52
+ message := " Project must have a primary location with a specified funding account"
53
+ )
54
+ );
55
+ marketingLocation: Location;
56
+ fieldRegion: FieldRegion;
57
+
50
58
link rootDirectory: Directory;
51
59
52
60
overloaded link projectContext: Project:: Context {
You can’t perform that action at this time.
0 commit comments