No Regrets Dispatch
Every morning the dispatch board pairs the day's service orders with the available technicians. Both sides have opinions: each order ranks the technicians (skills, distance, customer history), and each technician ranks the orders. Whenever the board publishes a pairing in which some order and some technician would both rather have each other than the partners they got, the planner's phone rings and the whole board gets reshuffled by hand. Your job is to compute an assignment nobody can complain about — no regrets.
Requirements
The starter contains two tables — keep their fields and keys exactly as shipped; the grading tests seed them and read them back:
"Dispatch Preference" — the ranking lists of both sides:
Side—Optionwith membersServiceOrder,Technician: whose ranking list this row belongs to"Agent No."—Code[20], the service order no. (whenSideisServiceOrder) or technician no. (whenSideisTechnician) doing the rankingRank—Integer, the position in that agent's list;1is the most preferred"Counterpart No."—Code[20], the agent on the other side being ranked- primary key:
Side,"Agent No.",Rank
"Service Assignment" — the result buffer:
"Order No."—Code[20], the primary key"Technician No."—Code[20]
Create a codeunit named "Service Dispatcher" with one public procedure:
procedure Dispatch(var DispatchPreference: Record "Dispatch Preference"; var ServiceAssignment: Record "Service Assignment")Solve it with Pro
You’re reading the opening of the statement. Pro unlocks the whole problem:
- The full statement
- Starter code in the browser editor
- 7 grading tests, run on Business Central 28.5
- 3 hints
- The reference solution
Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.
Already on Pro? Sign in