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?


Thanks for your feedback! Did this solve your issue?

Comments (optional):


Thanks for your feedback!
We're glad it was helpful but sorry it didn’t solve your issue. If you need assistance, click Chat with Support below.
We’re sorry to hear that. Please tell us why.

 I don't like how this works.

 The answer is confusing.

 The answer didn't match what I was searching for.

Additional Comments (optional):


Thanks for your feedback! If you need assistance, click Chat with Support below.
Thanks for your feedback. Help us make our products even better by sharing details in our Idea Banks or our online Community.
Thanks for letting us know. We'll work on clarifying the information in the article. If you need assistance, click Chat with Support below.
Thanks for letting us know. We'll work on updating the search engine to return more relevant results.