0

I have field in Template like Multilist with Search and Treelist with search. In these fields in the source a start search location is specified as below:

enter image description here

I need to find out all templates programmatically that contains fields whose Source starts with StartSearchLocation = {11111111-1111-1111-1111-111111111111}. Please suggest how can i achieve the same.

3

You can achieve the same using Sitecore PowerShell Extensions to get or modify the items.

Reference : https://doc.sitecorepowershell.com/working-with-items

You need to write a Script that recurse through the templates tree and get all items. Then you can check value of the the Source field that contains or starts with StartSearchLocation = {11111111-1111-1111-1111-111111111111}..

You could also do this in code.(using same logic as defined above)

Exaample Script :

$results = gci -path "/sitecore/templates" -recurse | Where-Object { $_.TemplateName -eq "Template field" -and $_.Fields["Source"].Value.StartsWith("StartSearchLocation={11111111-1111-1111-1111-111111111111}") }
$results

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.