How do I use a wildcard in an AIF Web service criteria element?
For example I need to find all customers whose name begin with “Light*”.
The C# code I thought would work goes like this:
CriteriaElement qe = new CriteriaElement();
qe.DataSourceName = “CustTable”;
qe.FieldName = “CustAccount”;
qe.Operator = Operator.Equal;
qe.Value1 = “Light*”;
I get absolutely nothing, as if the web service was literally searching for the term Light*, which of course does not exist.
Thanx
Soren B
And the FieldName would of course be “Name” not “CustAccount”. Still doesn’t work though.
/Soren
How do I use a wildcard in an AIF Web service criteria element?
For example I need to find all customers whose name begin with “Light*”.
The C# code I thought would work goes like this:
CriteriaElement qe = new CriteriaElement();
qe.DataSourceName = “CustTable”;
qe.FieldName = “Name”;
qe.Operator = Operator.Equal;
qe.Value1 = “Light*”;
I get absolutely nothing, as if the web service was literally searching for the term Light*, which of course does not exist.
Thanx
Soren B
Harish
September 17, 2009, 11:25am
3
Hi Soren,
In C# I understand you have to use regular expressions for such things.
Regards,
Hi Harish
Nope, tried using qe.Value1 = “^Light” ; instead of qe.Value1 = “Light*” ; but no luck. Still does not return any entitykeys at all.
/Soren
CriteriaElement qe = new CriteriaElement();
qe.DataSourceName = “CustTable”;
qe.FieldName = “Name”;
qe.Operator = Operator.Equal;
qe.Value1 = “^Light”;
Hello Soren,
Did you get a solution for this, i have very similar requirement.
Let me know if you have a solution or workaround.
Thanks
Soren,
You requirement is you need the customer name starts with “Light”. So no need to add any wild char.You should change the Operator value.It should be “GreaterOrequal”.
qe.Operator = Operator.GreaterOrEqual;
qe.value1 =“Light”;
Regards
Jeganeedhi
Hello Jeganeedhi,
Your sugestion is appreciated.
How do you do it if you want to search for “Light ”.
Is there an operator such as ‘like’ in SQL?
Nag