I have 2 BO's: Trip and Route. Trip owns Route and is a 1 to many relationship. Trip has the following attributes: NumberOfRoutes (type number) and Routes (type Route). Route has the following attributes: StopNumber (type number) and Trip (type Trip). Trip.NumberOfRoutes will contain the number or Route records for this trip. Each Route will be numbered 1, 2, 3, etc for each trip and this will be stored in the Route.StopNumber.
I thought the following rule in Route would accomplish this:
If Route.StopNumber IS UNDEFINED Then
Route.StopNumber=Route.Trip.NumberOfRoutes+1
Route.Trip.NumberOfRoutes=Route.StopNumber
The form to create a Trip has the Routes attribute displayed as Table of Items with a 'Add New' button.
Each time I press the 'Add New' button, a new route is created but the StopNumber for each is set to 1.
The following is from the log:
Executing action Route.Trip.NumberOfRoutes=Route.StopNumber from rules of object Route
-Unable to find Business objects to modify attribute Route.Trip.NumberOfRoutes
I have tried everything I can think of to get this to work but have failed miserably.
Any help would be greatly appreciated.
Additional information:
After pressing the 'Create' button to create the trip, the following appears in the log:
Processing cross reference...
Is this when the link between Trip and Route is actually established?
How do I number child relationships?
Hi Bob,
Did you put the rule I gave you on the Route BO? Make sure any other Route rules that begin with 'Route.StopNumber=' are removed.
No advanced tab changes were made.
To get it to work with a new trip, use a process like:
ENTER NEW Trip USING 'Trip with no routes'
EDIT Trip USING Main
In this case, 'Trip with no routes' is a form that does not include the Routes attribute. You will just be creating a 'shell' Trip in the first step in the process, then editing the Routes in the second step.
Did you put the rule I gave you on the Route BO? Make sure any other Route rules that begin with 'Route.StopNumber=' are removed.
No advanced tab changes were made.
To get it to work with a new trip, use a process like:
ENTER NEW Trip USING 'Trip with no routes'
EDIT Trip USING Main
In this case, 'Trip with no routes' is a form that does not include the Routes attribute. You will just be creating a 'shell' Trip in the first step in the process, then editing the Routes in the second step.
Tom - V8.8 build 3137 - MySql / PostGres
I am finally getting back to this.
First of all I would like to thank Tom for his help.
Secondly, I got this to work if I do not allow inline editing on Routes. If I allow inline editing, it does not work. With inline editing, the StopNumber is always set to 1.
I would really like to use inline editing if at all possible, any suggestions?
First of all I would like to thank Tom for his help.
Secondly, I got this to work if I do not allow inline editing on Routes. If I allow inline editing, it does not work. With inline editing, the StopNumber is always set to 1.
I would really like to use inline editing if at all possible, any suggestions?
Bob