
The Formula data type in a custom field allows you to create a formula that performs calculations using predefined functions, fields, and operators.
Scenario: Zylker, a courier package distribution company operating in India, has varying shipment durations depending on the state or city. To calculate the exact delivery date, Zylker creates a custom field to enter the number of days for the shipment and uses a formula custom field to add these days to the invoice date.
Here’s how this can be configured:
Step 1: Create a Custom Field for Shipment Days
- Go to the Settings at the top right corner of the page and go to Sales.
- Choose Invoices and select the Field Customization tab.
- Click + New Custom Field on the top right corner of the page.
- Enter the label name (say, Number of days for the shipment) and data type as Number.
- Enter the relevant details and click Save.
- Click + New Custom Field again.
- Enter the label name (say, Shipment Date) and choose data type as Formula.
- Enter the relevant details and choose Date from the dropdown against Output Data Type.
- In the Formula field, select ADDDATE from functions. Choose the invoice date and the created custom field (number of days for the shipment) from the fields column. Then add “DATE” to return the date.
- Click Save.
Read more about functions available in the formula custom field.