Error: “TypeError Cannot read property ‘indexOf’ of null” is encountered when saving an Invoice record. This JS_EXCEPTION error occurs when the script is accessing a certain line item field which is currently hidden from the a form.
Solution
The Custom Form should be updated so that the line item field is displayed.
- Edit the Custom Form
- Navigate to Customization > Forms > Transaction Forms
- Look for the preferred form used for Invoices
- Click the Edit link for the form
- Navigate to Sublist Fields tab
- Look for the field(s) used in the script
- Set Show checkbox to checked
- Click Save