Skip to content

Commit

Permalink
Added error info for Contains operators on condition. #706 #708
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed May 5, 2022
1 parent daa510c commit 95140b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions FetchXmlBuilder/Controls/conditionControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ protected override ControlValidationResult ValidateControl(Control control)
return new ControlValidationResult(ControlValidationLevel.Error, "Operator", ControlValidationMessage.InValid);
}

if (control == cmbOperator && cmbOperator.SelectedItem is OperatorItem opercon && (opercon.GetValue() == "contains" || opercon.GetValue() == "does-not-contain"))
{
return new ControlValidationResult(ControlValidationLevel.Error, "Contains (and not) are available, but not supported for FetchXml.",
"https://docs.microsoft.com/en-us/power-apps/developer/data-platform/fetchxml-schema#:~:text=%3Cxs%3AsimpleType%20name%3D%22operator%22%3E");
}

if (cmbOperator.SelectedItem != null && cmbOperator.SelectedItem is OperatorItem oper && (!oper.IsMultipleValuesType || Node.Nodes.Count > 0))
{
AttributeItem attribute = null;
Expand Down

0 comments on commit 95140b6

Please sign in to comment.