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.

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.


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

IssueWhat to check
A field I need isn't in the Field list.

Check:

  • Type the field name in the dropdown. The list doesn't show every option by scrolling.
  • For a custom field, confirm Store Value is checked and it's a body or line field.
  • If it's a List/Record field or a custom segment, create a Sourcing record for it.
  • Date, Multiple Select, Percent, and Text Area fields can't currently be used.
  • Some native fields aren't available, including Due To/From Subsidiary, NetSuite's native amortization fields, and Created By.
  • If the value lives on another record (such as a Project's status), it has to be copied onto the transaction first.
A Prevent rule didn't block a transaction.

Check:

  • The rule is Active and the exact transaction type is selected.
  • If the rule has no line Filters, Apply to Filtered Lines Only is turned off.
  • If you set Run On Type in System Settings, it includes the way this transaction was saved (for example, CSV Import).
  • The transaction has fewer lines than Max Lines for Execution, if that setting is filled in.
  • The change was a regular save. Inline edits and approvals don't run Prevent rules.
  • The transaction type is one Cross-Validation Rules evaluates. Work orders, item fulfillments, item receipts, inventory transactions, transfer orders, and estimates aren't evaluated.
  • Your SuiteApp is current. Several Prevent fixes shipped in recent versions. See Cross-Validation Rules Updating Your SuiteApp.
Rules don't run on CSV-imported transactions.

Check:

  • Under Setup > Import/Export > Import CSV Records, Run Server SuiteScript and Trigger Workflows is checked on the Import Options step. Without it, no rules are evaluated during the import.
  • If you set Run On Type in System Settings, it includes CSV Import.

A CSV import is rejected by a rule.

Check:

  • The error lists the rules that failed for that row, up to the number in Max Prevent Failures (25 by default; 0 shows all).
  • The internal IDs in your file. A wrong department or account ID can trip a rule even when the names look right. Enter one rejected line by hand in NetSuite to confirm.
  • If the error doesn't name a rule, look in the Script Execution Logs (see Viewing Script Errors). Cross-Validation Rules can pass along an error raised by NetSuite or another script.
SSS_USAGE_LIMIT_EXCEEDED or script errors on large transactions or imports.

Check:

  • Set Max Lines for Execution in System Settings. Prevent rules skip transactions with more lines than this number. There's no recommended value; start with a number above your usual transaction size and adjust.
  • Select only the transaction types each rule needs.
  • Your SuiteApp is current. Recent versions use less processing per save.

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:

  • Disable Client-Side Cross-Validation in System Settings is unchecked. When it's checked, a blocked save doesn't keep entered values.
  • Your SuiteApp is current. Keeping entered values on a blocked save needs a recent version.
An error message appears that no one typed.

Check:

  • The rule's Error Message field. It's optional; when blank, Cross-Validation Rules builds a message from the rule name, fields, and conditions. Fill it in to control the wording.
I'm not sure an error came from Cross-Validation Rules, or which rule.

Check:

  • The violation message names the rule and links to it. Open the rule to see its Filters, Requirements, and whether it's set to Prevent or Detect.
  • Errors in the Script Execution Logs from NTA | Transaction | UE come from the script that runs Cross-Validation Rules (and Shared Transactions) on save.
Another Netgain process that re-saves a transaction fails, such as clearing a Shared Transactions allocation.

Check:

  • The transaction against your Prevent rules. Any process that re-saves a transaction runs your rules, and a Prevent rule can block it. Fix the flagged fields, or set the rule to Detect, run the process, then set it back.

Viewing Script Errors

When something fails without a clear message, NetSuite's script logs usually show why.

  1. Go to Customization > Scripting > Script Execution Logs.
  2. Set Type to Error and narrow the date range to when the problem happened.
  3. 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.

Cross-Validation Rules Scripts

ScriptTypeWhat it doesWhen it runs
NTA | Cross-Validation Rules | SLSuiteletRuns the Cross-Validation Rules pages (rules, sourcing, reports) and the check a transaction form runs before it savesWhen you open a Cross-Validation Rules page, and on each save in the UI
NTA | CVR Report Writer | MRMap/ReduceWrites exception records when one save produces more violations than can be written during the saveAutomatically, 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.


Was this article helpful?