Thanks for the details.
On the first issue, we've fixed the message that we show at this time, so it includes the right operator (it was including the top-level op rather than the one from the Criterion).
On the second issue, when converting to simple-criteria, we actually allow a number of operators: equals/iEquals, iContains and startsWith. These essentially map to/imply a textMatchStyle, and iContains is the default for text fields. The logic that does this has been around for quite a while but we're having a discussion about tightening it up/doc-ing it more clearly and we'll update here when we have more information.
Announcement
Collapse
No announcement yet.
X
-
SmartClient Version: v13.0p_2023-08-30/AllModules Development Only (built 2023-08-30)
Chrome on MacOS
Hello, please try this code in the showcase https://www-demos.smartclient.com/sm...&skin=Twilight
Code:var c = { _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"countryName", operator:"iContains", value:"a" }, { fieldName:"population", operator:"lessThan", value:100000 } ] }; isc.logEcho(worldDS.splitCriteria(c, ["population"]))
Code:*17:18:39.020:MUP0:WARN:Log:splitCriteria: advanced criteria second-level operator:and for field:population cannot be converted to simple criteria format
Then please try this test case:
Code:var c = { _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"countryCode", operator:"equals", value:"DO" }, { fieldName:"countryName", operator:"iContains", value:"a" } ] }; isc.logEcho(worldDS.splitCriteria(c, ["countryName"]));
Code:*17:22:59.037:MUP7:WARN:Log:{countryName: "a"}
Leave a comment:
-
Please show your full sample code and we'll take a look - there could be spelling and other mistakes that we can't know about until we see the code.
Leave a comment:
-
Hello Isomorphic, yes worldDS from the showcase.
Sorry for the invalid date, but actually the behaviour is the same if you remove that criterion altogether
Leave a comment:
-
Is this targeted at our sample worldDS? That date-string isn't valid for a date field.
Can you show sample code?
Leave a comment:
-
Hi Blama thanks for the heads up, but the result is the same, I don't think it's a required attribute.
Leave a comment:
-
claudiobosticco you wrote _constructor:"AdavancedCriteria", which has a typo two times.
Best regards
Blama
Leave a comment:
-
question about DAtasplitCriteria()
SmartClient Version: v13.0p_2023-08-29/AllModules Development Only (built 2023-08-29)
sorry for the mispelled title, should be "questions about DataSource.splitCriteria()"
Hello, if I define an AdvancedCriteria like this:
Code:var c = { _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"countryName", operator:"iContains", value:"a" }, { fieldName:"population", operator:"lessThan", value:100000 }, { fieldName:"independence", operator:"greaterThan", value:"1500-08-02" } ] };
Code:worldDS.splitCriteria(c, ["population"]);
Code:*11:55:20.994:XRP0:WARN:Log:splitCriteria: advanced criteria second-level operator:and for field:population cannot be converted to simple criteria format
Second question. If I define another criteria:
Code:var c = { _constructor:"AdvancedCriteria", operator:"and", criteria:[ { fieldName:"countryCode", operator:"equals", value:"DO" }, { fieldName:"countryName", operator:"iContains", value:"a" } ] };
Code:worldDS.splitCriteria(c, ["countryName"]);
{countryName: 'a'}Tags: None
Leave a comment: