Formula Documentation

Formula examples for calculated fields

Important: always use the Field Key / Object Name as the variable in your formula. Do not use the display label if it has spaces.

Example: if your display label is Paid Amount but your field key/object name is paid_amount, then your formula must use paid_amount.
Basic multiplication

Use for total amount, stock value, invoice total, etc.

print(quantity * unit_price)
Round result

Use when you need 2 decimal places.

print(round(quantity * unit_price, 2))
Paid / Due status

Use object name like paid_amount.

if paid_amount > 0:
    print("Paid")
else:
    print("Due")
Balance due

Use for fee, payment, invoice, or collection apps.

due = total_amount - paid_amount

if due > 0:
    print(due)
else:
    print(0)
Grade / status condition

Use nested conditions with object names.

if marks >= 90:
    print("A+")
elif marks >= 75:
    print("A")
elif marks >= 50:
    print("Pass")
else:
    print("Fail")
Safe division

Avoid divide-by-zero errors.

if total_days > 0:
    print(round(present_days / total_days * 100, 2))
else:
    print(0)
Simple serial number

For new blank serial fields like sr_no.

print(start_increment(sr_no))
Reverse serial number

Counts from last row to first row.

print(start_decrement(sr_no))
Serial with prefix

Creates INV-1, INV-2, INV-3...

print(start_increment("INV-" + sr_no))
Serial with suffix

Creates 1-A, 2-A, 3-A...

print(start_increment(sr_no + "-A"))
Alphabet serial

Creates A, B, C... Z, AA, AB...

print(start_alphabet_increment(sr_no))
Alphabet + number

Creates A1, B2, C3...

print(start_alphabet_increment(sr_no) + start_increment(sr_no))
Advanced Python features like imports, file access, networking, and unsafe code are blocked for security.