create a new custom field in the Bill Payment Record with a specific formula for default value:
- Create the Custom Field:
- Navigate to Customization > Lists, Records, & Fields > Record Types.
- Select the Bill Payment record type.
- Click on “New Field”.
- Set Field Attributes:
- Fill in the necessary details such as Label, ID, Type, etc.
- Formula Setting:
- Under the “Validation and Defaulting” subtab, check the “Formula” checkbox.
- In the “Default Value” field, enter the following formula, replacing
{total}with the appropriate field ID for the amount you want to convert:
CASE
WHEN {total} = 0 THEN ‘ZERO’
ELSE
INITCAP(
TO_CHAR(
TO_TIMESTAMP(
LPAD(TRUNC({total}, 0), 9, ‘0’),
‘FF9’
),
‘FFSP’
)
) || ‘ Dollars ‘ ||
(CASE
WHEN {total} – TRUNC({total}, 0) > 0 THEN
‘and ‘ ||
(CASE
WHEN LENGTH(TO_CHAR(REGEXP_REPLACE({total}, ‘^[0-9]+.’, ”))) = 1 THEN
INITCAP(
TO_CHAR(
TO_DATE(
TO_CHAR(TRUNC(REGEXP_REPLACE({total}, ‘^[0-9]+.’, ”), 0) * 10),
‘J’
),
‘JSP’
)
) || ‘ Cents’
ELSE
INITCAP(
TO_CHAR(
TO_DATE(
TO_CHAR(TRUNC(REGEXP_REPLACE({total}, ‘^[0-9]+.’, ”), 0)),
‘J’
),
‘JSP’
)
) || ‘ Cents’
END)
ELSE ”
END)
END
Using the Custom Field in Check PDF Template:
- Customize the Check PDF template to include the newly created custom field.
Replace the {total} placeholder with the specific field ID of the amount field you intend to convert to words.