Error: This ad-hoc query includes one or more fields that have been removed from the underlying source query view.

When previewing the results of a query the following error may occur:

Error:  This ad-hoc query includes one or more fields that have been removed from the underlying source query view.  You can edit the query to see more information and make appropriate adjustments.
This message typically indicates that a field that existed in the saved query is no longer present in the database.  When the following conditions exist on a query, this error may also occur:

Sort on a “<Record type> record” field on a child node.
Example: Create a Constituent query, add the field “Revenue\Revenue record” to the output, and sort on that field.
Solution: It is not necessary to sort on “<Record type> record” field. The order the records will appear will not make sense outside of the software

Sort on an aggregated “<Record type> record” field on a child node:
Example: Create a Constituent query, add the field “Revenue\Revenue record” to the output, summarize it as a COUNT, and sort on that field.
Solution: COUNT on a different field. In our example above, “Revenue ID” works.

Sort on an “Exists in <selection>” field on a child node:
Example: If you don’t have one already, create a Revenue selection marked “Show this Selection in the Query Designer”. Create a Constituent query, open the Revenue node, go to the Selections node, and add the “Exists in <selection>” field to the output, and sort on that field.
Solution: Change the field’s column header to something else. In our example above, right-click the output field and change its header to “My Field”, and sort on the field.

Sort on an aggregated “Exists in <selection>” field on a child node:
Example: If you don’t have one already, create a Revenue selection marked “Show this Selection in the Query Designer”. Create a Constituent query, open the Revenue node, go to the Selections node, and add the “Exists in <selection>” field to the output, summarize it as a COUNT, and sort on that field.
Solution: Change the field’s column header to something else. In our example above, right-click the output field and change its header to “My Field”, and sort on the field.

In order to prevent this message it is recommended to not sort by the ID field.

Environment

 4.0.138

Was this article helpful?