Scope
I got a error message that custom field cannot be blank on checkout page/portal/In-app script
{"errors":[{"message":"There were errors while submitting"},{"param":"cf_occupation","message":"cannot be blank"}]}"
Summary
If this error pops up with custom fields then please follow the below steps.
By default, a new custom field will be set as ‘Use as hidden parameter’ on Checkout. Hence, to avoid this error, you can set the Custom field as Mandatory/Show to display in Checkout. You can enable this under the Fields section of the Checkout & Self-Serve Portal setting.
Solution
Navigate to Settings >> Checkout & Self-Serve Portal (under Customer-facing essentials section) >> Fields.
You will find the customer-level custom fields under Account Information and the Subscription level custom fields under Custom fields for subscription tabs respectively on the left panel. Just pick the appropriate custom field, and click the edit icon (which looks like a pen icon).
For example, we have a created a Custom field as ‘Occupation’ which by default with be 'use as hidden parameter'.
Change the status to ‘Mandatory’ or ‘Show’ as per your requirement In the checkout to avoid this error.
Then, click on ‘Publish’ for the changes to take effect on the Checkout pages. You can also use ‘Preview Checkout/Portal’ to review the updated status.
Related Links:
Error - quantity[0]: “Cannot be blank” when multi decimal support is enabled
How to pass values to custom fields using in-app scripts?
Pre-filling/Passing custom fields to hosted pages (via Plan URL)