In a NetSuite saved search of type Customer, I wan...
# ask-stanley-ai
c
In a NetSuite saved search of type Customer, I want to return only parent (top-level) customers — i.e., exclude any customer that is a sub-customer of another. Context: in my account, sub-customers have IDs like 70121:2 (parent_id:N) and a populated Parent Customer field; top-level parents have IDs like 70121 with the Parent Customer field empty. Questions: 1. What is the cleanest, most idiomatic filter to add on the Criteria tab to restrict results to top-level parent customers only? Give me the exact field name as it appears in the filter dropdown, the operator, and the value. 2. If the standard "Parent Customer is empty" approach isn't available or behaves unexpectedly, what's the recommended formula alternative (Formula (Numeric) or Formula (Text))? Give the exact formula syntax. 3. Are there any gotchas — e.g., does the Parent Customer filter also exclude customers that are projects/jobs, or do I need a separate isjob = F filter? 4. Is there a difference between filtering on {parent} vs {parent.internalid} in a formula? Which should I prefer? Please answer with concrete NetSuite saved-search builder steps, not generic SQL advice.
c
AI generated answer (using internal Slack threads):
1. The cleanest, most idiomatic filter to add on the Criteria tab to restrict results to top-level parent customers only is to use the "Sub of" field. Set the operator to "is" and the value to "-None-". This will exclude any customer that is a sub-customer of another. 2. If the standard "Parent Customer is empty" approach isn't available or behaves unexpectedly, you can use a Formula (Text) with the following syntax:
NVL({parent}, '') IS NULL
. This formula checks if the parent field is null or empty. 3. Yes, there are some gotchas. The Parent Customer filter does not necessarily exclude customers that are projects/jobs. You may need to add a separate filter for
isjob = F
to exclude these. 4. There is a difference between filtering on
{parent}
vs
{parent.internalid}
in a formula.
{parent}
refers to the parent record itself, while
{parent.internalid}
refers to the internal ID of the parent record. In most cases, you should prefer
{parent}
as it is more straightforward and less prone to errors due to ID mismatches. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.843261719
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.839843869
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833496094
Please provide your feedback on this answer.