Use case · By object · Orders

Flag loads running past plan with a transit-days formula

Add a Transit Days formula field to the Order object: dateDiff from First Pickup to Last Delivery in days, so every load carries its planned trip length.

Published November 5, 2026Verified on release 2026.11
On this page3 sections
  1. The situation
  2. The workflow
  3. Extend it

The situation

ORD-28 leaves Gary, Indiana for Dallas, 815 miles of flatbed steel, with a first pickup on Aug 19 at 07:00 and a last delivery on Aug 21 at 13:00. How long is that trip? You can work it out, but only by reading two date columns and subtracting in your head, and a dispatch lead does that on every load on the board, every morning. The load booked for four days on a two-day lane is the one nobody did the sum for, and the customer finds it before you do. A Transit Days field on the Order does the subtraction once, on every order, and because a formula field works it out from the two dates, nobody types it and nobody has to keep it up to date when an appointment moves.

The workflow

The formula is one line. You insert both dates from the editor’s field list, so they appear as chips rather than typed text:

dateDiff({First Pickup}, {Last Delivery}, "days")

It reads: from the first pickup to the last delivery, in days. The clip above covers steps 1 to 5 and then cancels, so nothing was saved on the demo org.

  1. Click Settings, then Objects, and open Order. Object Builder opens on Available fields. Check that your order has First Pickup and Last Delivery. They are the two dates the formula reads.
  2. Click Create custom field. Type Transit Days in Field name, pick Formula in Field type, and click Set formula. The editor opens on an empty formula box.
  3. Type dateDiff(, then type { and the start of First Pickup, and press Enter to insert it. Type , , then { again and insert Last Delivery. Keep that order: the pickup first, the delivery second, the same way you would say the trip out loud.
  4. Close the formula with , "days"). The unit goes in plain quotes after the two dates.
  5. When the formula is complete, Output opens below the box and reads Measurement, Duration, Day (d). That tells you the field holds a length of time in days, not another date, so every order now carries its trip length as one value you can compare across loads.
  6. Click Set formula, then Create. In Available fields, click Add beside Transit Days so it shows on the Order next to the two dates, then click Save changes.
  7. Open an order where you know the answer. On the Orders board, click ORD-28: First Pickup reads Aug 19, 2026 @ 07:00 and Last Delivery reads Aug 21, 2026 @ 13:00. That is 2 days 6 hours, so Transit Days should show two and a quarter days. The field keeps the hours and does not round to 2. If it reads below zero, the two dates went in the wrong way round, so swap them.

From here, every order works out its own transit time each time someone reads it. When a customer moves the delivery appointment, Transit Days changes too, and nobody re-keys anything. The formula fields page covers the editor itself: the function groups, and what to check before a board relies on a formula.

Extend it

  • See which loads are running long. A second formula field, wholeDaysSince({First Pickup}), counts the whole days since the load picked up. Put it beside Transit Days. Once the days on the road pass the planned days, the load is running past plan, and you know before the consignee calls. The late ETA alerts page covers telling dispatch and the customer when that happens.
  • Put it on the board. On the Orders board, click Configure, then Columns, and move Transit Days into Shown fields. Check that the column sorts the way you expect before you save a view such as Long hauls. Views are covered in board views.
  • Measure other gaps the same way. dateDiff works on any two date fields on the order. Lead time from booking to first pickup is one example, and a dwell between two stops is another. For a money number on the same object, the thin-margin loads page builds a Margin % field with the same editor.