Start a new topic
Solved

Get-ERPObjects with case insensitive filter

Hello,


I have this query is ps1 for powerGate Serach windows in Vault Explorer

   

function SearchItem
{
	$searchNumber = $dsWindow.FindName("searchNumber").Text.ToLower()
	$searchDescription = $dsWindow.FindName("searchDescription").Text.ToLower()
	
	$result = Get-ERPObjects -EntitySet "ItemMethod" -Filter "substringof('$searchNumber',No) eq true and substringof('$searchDescription',Description) eq true" -OrderBy @{"No"="Ascending"}

	$dsWindow.FindName("searchResults").ItemsSource = $result
}

How to perform a filter case insensitive on Description properties?


Thanks in advance


hi Xavier, you can use ToUpper in your filter. This should work:

substringof('$($searchDescription.ToUpper())',toupper(Description)) 

 You can find the supported URI conventions here: https://www.coolorange.com/wiki/doku.php?id=powergateserver:plugins:creating_a_custom_plugin:query_and_iexpression#filter


hope this helps


p.s.: please mark as solved if this solves your problem


1 person likes this

Thanks, it works.

Login or Signup to post a comment