Why do Saved Searches have a new XML definition, s...
# sdf
r
Why do Saved Searches have a new XML definition, seems like any time I use Update All Objects with Account Objects from WebStorm? Without editing the Saved Searches. What is going on here?
s
Could be that the xml body is timestamped to import date so even though search definition itself didn’t change your version control would pick up the diff, could be wrong though
g
IIRC the first part of the definition (until the first
@
) changes every time. There might be some timestamp there as Simon said, or some other generative function. We recently published a blog post on decoding saved searches for those who are really curious (+link to some open-source code that does that).
e
We've removed all Saved Searches from our SDF project because of this and the issue with requiring them to be Public in order for SDF to manage them. We now list Saved Searches as dependencies, but we do not pull the definitions into the project.
n
@erictgrubaugh so since you removed the searches from SDF, if they are referenced in a custom record are you adding that after the fact (after you deploy the custom record for example via sdf)
e
Any searches required by other Objects are listed in the
manifest.xml
as dependencies; we just don't put the search definition in our SDF project
n
So in a custom record the search is added like this under recordsearch. How would that be handled with what you are referencing?
e
@Nicholas Williams The search is included in the
manifest.xml
as a dependency, like so
n
@erictgrubaugh right but if you add the search via UI you would have to have the custom record deployed via SDF first since the search utilizes those custom records. But then the custom record references this search so you would want the search first. Im stuck in a cycle here
e
I was answering the question of what we do with saved searches in SDF, rather than the question of how to resolve a circular dependency in SDF. We have several similar circular dependencies (e.g. records referencing tabs which reference the record) in our SDF project, but none of them cause validation errors or deployment failures; they're just WARN level notifications during validation. What is the behavior that you see instead?
n
@erictgrubaugh ah yes that makes sense. Here is the error I get
Copy code
An error occurred with resolving custom object references.
Details: The script id '[scriptid=customrecord_nco_eq_grouplist]' referenced by object field 'dependency' could not be resolved.
File: ~/Objects/search_C/customsearch_dc_sublist_eq_by_prod_line.xml
Object: customsearch_dc_sublist_eq_by_prod_line (savedsearch)
message has been deleted