An inline formula, <UnconditionalFormula>, can be either horizontal or aggregate. The main difference regarding Global Formulas is that inline may not consist in several conditional expressions, not even a single conditional one. In addition, as in any inline formula, variables could be involved in the expression (because the formula does only exists in this local piece of code, where the variable is known. Whereas we really don't know all the places where a global formula is going to be triggered. This is the meaning of "global". It can be used everywhere an attribute of the corresponding base table is allowed)

While a global formula always has a table in its context (the table where the formula attribute would be stored if it were not virtual), an inline formula does not have to. For what kind of formulas? Those that don't need context to be evaluated: Aggregate Formulas.

Assume we have a FlightInstance transaction to store a real flight from one country/city to another, with a second level, FlighInstanceSeat, to store the passengers of the flight. Suppose a procedure needs to know at the begining if there already are more than 100 seats assigned to passengers in the corresponding table.

&success = Count( FlightInstancePassengerSeatNumber ) > 100

Here there is not a context table for the formula. It is triggered isolated, counting all the records of its base table, FlightInstanceSeat. It will count all the passengers for all the flight instances stored.

On the other hand, if the above code were inside a for each command, such as:

The formula does have a context: the FlightInstance table, base table of the For each. Thus, not all the passenger seats were going to be counted, but only those corresponding to each FlightInstance record considered in each "for each" iteration. So, only the flights with more than one hundred passengers will be printed in output.

If we had defined a global formula attribute FlightInstanceNumberOfPassengers at FlightInstance transaction level, we could have defined equivalently as follows:

Inline formulas that are horizontalalways have a context table: at least its own base table. It is exactly the same as horizontal global formulas. Thus, they can not be specified without a context where the attributes could assume value.

For example:

&age = &today.Year() - PassengerBirthDate.Year()

this assignment isolated makes no sense. What passenger birth date are we talking about? Situation would be different if this assignment were:

Here GeneXus infers the passenger is that of each "for each" iteration, that is, that associated to the for each base table record where we are positioned each time. The "for each" navigates the table that stores the passengers assigned to seats: FlightInstanceSeat. Note in this case the context table, FlightInstanceSeat, is not exactly the base table of the formula, Passenger, but the former contains in its extended the latter.