Cross-Validation Rules Tips and Troubleshooting
Overview
This article covers tips and troubleshooting for Cross-Validation Rules. It is a companion to the Cross-Validation Rules Overview article. If a field is missing from the Field list, a Prevent rule didn't block a transaction, or a CSV import fails on a rule, start with the Troubleshooting section.
Tips
The Field list shows standard fields, your custom fields, and anything you've sourced.
The Field dropdown on Filters and Requirements includes:
- A set of standard fields: Memo (Body), Memo (Line), Subsidiary, Transaction ID (Body), Entity, Item, User, Role, Accounting Book, Amount (Line), Amount Debit (Line), Amount Credit (Line), Amount Total, Account, Account Debit (Line), Account Credit (Line), Account Type (Line), Account Type Debit (Line), and Account Type Credit (Line).
- Your custom transaction body and line fields with Store Value checked, when the field type is Free-Form Text, Integer Number, or Currency.
- Every active Sourcing record. A Sourcing record adds a List/Record custom field or a custom segment to the list, using the Sourcing record's Name as the label, so give it a name your team will recognize.
Custom Fields
List/Record custom fields and custom segments must be sourced before they show in the Field list.
The list shows a limited number of options at a time, so not every field is visible by scrolling. Type the field name in the dropdown to find it.
A rule can only check values stored on the transaction.
Cross-Validation Rules reads the fields on the transaction body and lines. It can't look up a value stored on a related record, such as the status of the Project on a line. To validate a value like that, it first has to be copied onto the transaction in a custom field, and that field has to be populated when the transaction is saved.
The Entity field in NetSuite represents both Vendors and Customers.
When configuring a Filter or Requirement that references a Vendor or Customer, the correct field to select is Entity. NetSuite uses Entity as a single field to represent both Vendors and Customers depending on the transaction type.
On Sales Orders the header entity is evaluated on every line; on Purchase Orders it is not.
When a rule evaluates the Entity on transaction lines, Sales Orders treat the header Customer as if it were present on every line, because NetSuite inherits the header customer onto each line. Purchase Orders do not work this way - the header Vendor is only evaluated on a line where it actually appears. When writing an entity-based Requirement for Purchase Orders, scope it to the lines where the vendor is populated rather than assuming the header vendor applies to every line.
User means the person saving the transaction.
The User field checks who is saving the transaction at that moment, not who created it. If one person creates a transaction and someone else edits it later, the rule checks the person editing. This makes User a good way to exempt or restrict an integration user. There is no Created By field. The User list shows active employees with login access.
When a rule has multiple Filters, a transaction must meet all of them to be evaluated.
Filters work as AND logic, not OR. A transaction that matches only some of the filters isn't evaluated. Line-level filters must all match on the same line.
To match any one of several values, use one filter with the any of operator and select all the values in it. Adding a separate filter row for each value requires a line to match every row at once, which never happens.
Apply to Filtered Lines Only scopes Requirements to lines that match line-level Filters.
When the Apply to Filtered Lines Only checkbox is enabled on a Requirement, the system evaluates that Requirement only against transaction lines that matched the line-level Filters. When it is disabled, the Requirement applies to all lines on the transaction.
For example: if a Filter is set to Account Type (Line) Equals Income, and a Requirement is set to Class Cannot Be Empty, enabling Apply to Filtered Lines Only means only the Income line(s) must have Class populated. Disabling it means every line on the transaction must have Class populated.
Debit requirements apply only to debit-side lines, and credit requirements apply only to credit-side lines.
Turn it off on rules with no line Filters
If a rule has no Filters, or its only Filters are User or Role, there are no filtered lines. With Apply to Filtered Lines Only enabled, a Prevent rule then has nothing to check and never blocks a save. The rule screen shows a notice when this happens. Turn the checkbox off on these rules.
Pick the Account field that matches the lines you want to check.
Account checks the account on every line. Account Debit (Line) and Account Credit (Line) check only lines on that side of the transaction. On a Vendor Bill, the expense and item lines are the debit side. The same pattern applies to Account Type and Amount.
A rule runs only on the exact transaction types selected.
Journal Entry and Advanced Intercompany Journal Entry are separate types, for example. Select every type the rule should cover.
Prevent rules don't see tax lines that NetSuite generates automatically.
When NetSuite automatically creates tax lines on a transaction, a Prevent rule can't read them, so a rule that evaluates all lines won't apply to those tax lines. Detect rules read the lines the transaction posts to the GL, which can include tax lines. Keep this in mind if a Detect rule flags something a Prevent rule with the same setup didn't.
Prevent and Detect can give different results for the same rule.
Prevent rules check the transaction before it saves. Detect rules check the saved transaction afterward. Because of this, a few situations behave differently:
- Inline edits and approvals run Detect rules, but not Prevent rules.
- The Max Lines for Execution and Run On Type settings limit Prevent rules only. See Cross-Validation Rules System Settings.
- Tax lines, covered in the tip above.
If a Detect rule flags a transaction that a Prevent rule didn't block, check these first.
The Reported Exceptions and Outstanding Exceptions reports serve different purposes and should be used together.
The Reported Exceptions report logs exceptions at the time each transaction is saved. It captures a historical record of every violation - whether the transaction was blocked (Prevent) or allowed through (Detect) - and tracks the resolution status of each exception. Use this report as your primary working view for reviewing, investigating, ignoring, and resolving flagged transactions.
The Outstanding Exceptions report runs a live query against current transaction data to identify violations that exist right now, regardless of when the transactions were saved. Unlike the Reported Exceptions report, it reflects the current state of your data rather than a historical snapshot. Use this report for periodic compliance checks and to identify violations that may have been introduced through data changes outside the normal save process.
See Cross-Validation Rules Reports for full documentation on both reports.
Transactions created by User Event Scripts will not appear on the Reported Exceptions report.
Due to a NetSuite platform limitation, Cross-Validation Rules cannot be triggered by User Event Scripts. Transactions created by User Event Scripts that violate a Prevent-type rule will not be blocked at save time and will not be logged on the Reported Exceptions report. These transactions will, however, appear on the Outstanding Exceptions report, which queries transaction data directly. If your environment uses User Event Scripts to create transactions, the Outstanding Exceptions report is essential for identifying violations introduced through that process.
No email goes out when a rule is violated.
Cross-Validation Rules doesn't notify the user who triggered an exception. To keep people informed, create a saved search on the Netgain Tools Rule Report record type, which holds one record per exception with the rule, transaction, user, and role. Share it or schedule it as an email.
Prevent error messages identify the line that tripped the rule.
When a Prevent rule blocks a save, the Cross-Validation Rule Violations window groups each violation by its sublist (Items, Expenses, Lines) and lists the specific line number beneath it, with the failed requirement under the line. Violations on transaction body fields are grouped under Header. If one rule is violated on several lines, each line is listed so you can fix them together. See Cross-Validation Rules Testing Rules & Reviewing Reports for details.
Troubleshooting
| Issue | What to check |
|---|---|
| A field I need isn't in the Field list. | Check:
|
| A Prevent rule didn't block a transaction. | Check:
|
| Rules don't run on CSV-imported transactions. | Check:
|
| A CSV import is rejected by a rule. | Check:
|
| SSS_USAGE_LIMIT_EXCEEDED or script errors on large transactions or imports. | Check:
On very large transactions, Prevent rules can stop checking part-way when NetSuite's processing limit runs low, and the save goes through. Use the Outstanding Exceptions report to find violations on those transactions. |
| A Transaction Type isn't available when configuring a rule. | Check:
|
| A blocked save cleared what I entered. | Check:
|
| An error message appears that no one typed. | Check:
|
| I'm not sure an error came from Cross-Validation Rules, or which rule. | Check:
|
| Another Netgain process that re-saves a transaction fails, such as clearing a Shared Transactions allocation. | Check:
|
SuiteApp Update
If these steps don't resolve your issue, you may need a SuiteApp update. Cross-Validation Rules ships inside the Shared Transactions by Netgain SuiteApp. You can upgrade sandbox yourself; for production, email support@netgain.tech. See Cross-Validation Rules Updating Your SuiteApp.
Viewing Script Errors
When something fails without a clear message, NetSuite's script logs usually show why.
- Go to Customization > Scripting > Script Execution Logs.
- Set Type to Error and narrow the date range to when the problem happened.
- Look for entries from the scripts listed below.
Log titles start with the script prefix, for example NTA | error running cross validation rules, followed by the error details.
For the report writer job, go to Customization > Scripting > Map/Reduce Script Status and filter on NTA | CVR Report Writer | MR.
When you contact support
Include the script name, the error text, the date and time it happened, the transaction, and the rule involved.
Cross-Validation Rules Scripts
| Script | Type | What it does | When it runs |
|---|---|---|---|
| NTA | Cross-Validation Rules | SL | Suitelet | Runs the Cross-Validation Rules pages (rules, sourcing, reports) and the check a transaction form runs before it saves | When you open a Cross-Validation Rules page, and on each save in the UI |
| NTA | CVR Report Writer | MR | Map/Reduce | Writes exception records when one save produces more violations than can be written during the save | Automatically, after a save with many violations |
The NTA | Transaction | UE and NTA | Transaction | CS scripts also run automatically on transaction saves. They evaluate your rules and are shared with Shared Transactions.
Frequently Asked Questions
Do rules run on transactions created before the rule existed?
Yes, when they're edited. Prevent and Detect rules run every time a transaction is created, edited, or copied, whatever its date. To find older transactions that violate a rule without editing them, use the Outstanding Exceptions report.
Can a rule use Detect for manual entries and Prevent for imports?
Not per rule. The Run On Type setting in System Settings limits all Prevent rules to the ways of saving you select, such as User Interface or CSV Import. To exempt one integration, add a User filter for the integration's user.
Can a rule stop someone from clicking a button until a field is filled in?
No. Rules run when the transaction is saved.
Does Cross-Validation Rules email the user who caused an exception?
No. Use a saved search on the Netgain Tools Rule Report record type, as described in Tips.
What is the NTA | CVR Role field in a transaction's System Notes?
Cross-Validation Rules stamps it with the role of the person saving the transaction, so Detect rules that filter on Role can check it after the save. It changes whenever someone with a different role saves the transaction.
How do I import a rule whose filter uses "any of"?
Rules, filters, and requirements are imported separately. For an any of filter, put all the internal IDs in one cell, separated by commas (for example, 12,15,18). One ID per row creates separate filters that a line must all match. See Cross-Validation Rules Importing rules.
Why do I upgrade Shared Transactions to get Cross-Validation Rules changes?
Cross-Validation Rules ships inside the Shared Transactions by Netgain SuiteApp. There's no separate listing. See Cross-Validation Rules Updating Your SuiteApp.
Still Need Help?
Email support@netgain.tech. Include the rule name, the transaction, what you expected to happen, any error text with its date and time, and your SuiteApp version if you know it.
