Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT 14.1 Period In Criteria fieldName

    SmartGWT Enterprise 14.1-p20250611

    We're migrating from SmartGWT 13.0 to 14.1. We have some criteria field names that have a period in them. This seems to now be breaking in 14.1.

    Here's the criteria:

    Code:
    data:{
            operator:"and",
            criteria:[
                {
                    fieldName:"fromCustomPB",
                    operator:"equals",
                    value:false
                },
                {
                    fieldName:"company_id",
                    operator:"equals",
                    value:"6185077"
                },
                {
                    fieldName:"priceBookIds",
                    operator:"equals",
                    value:211558608
                },
                {
                    fieldName:"hdwLineId",
                    operator:"equals",
                    value:211967104
                },
                {
                    fieldName:"vendorIds",
                    operator:"equals",
                    value:63
                },
                {
                    fieldName:"hdwTypeId",
                    operator:"equals",
                    value:"ED"
                },
                {
                    fieldName:"attr1.hdwAttrId",
                    operator:"inSet",
                    value:[
                        215777778
                    ]
                }
            ]
        },
    and the stacktrace for the error:

    Code:
    2025-06-17 11:57:27.371 ERROR - dsRequest.execute() failed:
    java.lang.Exception: fieldQuery specifies dataSource 'attr1', which is not known
        at com.isomorphic.datasource.DSRequest.extractCriteriaSubquery(DSRequest.java:2263) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.datasource.DSRequest.extractCriteriaSubqueries(DSRequest.java:1928) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.datasource.DSRequest.extractCriteriaSubqueries(DSRequest.java:1900) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.datasource.DSRequest.normalizeCriteria(DSRequest.java:1685) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:4549) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:256) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:213) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:153) ~[isomorphic-core-rpc-14.1-p20250611.jar:?]
    It looks like the content before the period is being treated as another data source?

    #2
    Field names have to be valid Java/JavaScript identifiers, and that's a requirement that goes back 20 years. It's surprising to hear that this field was functional at all before, as many if not most pathways through the system would have blown up due to the invalid field name.

    Perhaps your use of this field happened to "thread the needle" and avoid all the codepaths that blow up - like maybe it's a non-visible field with no validators, and you didn't notice the other ways in which it was malfunctioning?

    Anyway, yes, in 14.x, dot notation is now used in several new features: relational validation, criteria, ruleScope / *When rules, etc. This was always the plan, but we finally got there!

    How difficult is a rename going to be for you? We could consider some kind of flag to take these fields back to the semi-working state you had before, but it would be a temporary thing, as even more dot-notation-based features are in process right now.

    Comment


      #3
      FieldNames must be valid js identifiers: https://www-demos.smartclient.com/sm...ype..FieldName

      maybe in this case this wasn't enforced, before

      edit: Oh sorry, Isomorphic beat me to it with a more detailed answer.

      Comment


        #4
        Even so, thanks Claudio!

        Comment


          #5
          Thank you for the info. We'll work on renaming since that will be required going forward.

          Comment

          Working...
          X