Announcement

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

    validator cannot find serverCondition?

    I've got a really odd issue. This seems to work in some instances, and not in others. I haven't been able at this point to figure out what might be triggering it. It seems to happen consistently in some environments and not others.

    This is on SmartClient Version: v9.1p_2015-05-30/PowerEdition Deployment (built 2015-05-30)

    Logged RPC response:
    Code:
    14:29:31.469:XRP6:WARN:RPCManager:'serverCustom' validator has neither serverCondition nor serverObject declarationundefined - response: {operationId: "custom",
    clientContext: Obj,
    internalClientContext: Obj,
    context: Obj,
    transactionNum: 4,
    httpResponseCode: 200,
    httpResponseText: "//isc_RPCResponseStart-->[{affectedRows:..."[217],
    xmlHttpRequest: [object XMLHttpRequest],
    transport: "xmlHttpRequest",
    status: -1,
    clientOnly: undef,
    httpHeaders: Obj,
    isStructured: true,
    callbackArgs: null,
    results: Obj,
    affectedRows: 0,
    data: "'serverCustom' validator has neither ser..."[81],
    invalidateCache: false,
    isDSResponse: true,
    queueStatus: -1,
    startRow: 0,
    endRow: 0,
    totalRows: 0}

    RPCRequest:
    Code:
    {
        "actionURL":"http://myserver/myapp/isomorphic/IDACall", 
        "showPrompt":false, 
        "transport":"xmlHttpRequest", 
        "promptStyle":"cursor", 
        "bypassCache":true, 
        "data":{
            "values":{
                "STATUS":"A", 
                "EFF_DATE":"2015-06-05", 
                "CODE":"5", 
                "TITLE":"Y"
            }, 
            "operationConfig":{
                "dataSource":"MYDS", 
                "repo":null, 
                "operationType":"add", 
                "textMatchStyle":"exact"
            }, 
            "componentId":"MYDS_Grid", 
            "appID":"builtinApplication", 
            "operation":"MYDS_add", 
            "oldValues":{
                "STATUS":"A", 
                "EFF_DATE":"2015-06-05", 
                "CODE":"5", 
                "TITLE":"Y"
            }
        }
    }
    Raw Response:
    Code:
    [
        {
            affectedRows:0, 
            data:"'serverCustom' validator has neither serverCondition nor serverObject declaration", 
            invalidateCache:false, 
            isDSResponse:true, 
            queueStatus:-1, 
            status:-1
        }
    ]
    MYDS datasource:
    Code:
    <DataSource serverType="sql" dbName="SQLServer" schema="dbo" tableName="MYDS" ID="MYDS" autoDeriveSchema="true">
      <fields>
      	
        <field name="MYDS_ID" type="sequence" primaryKey="true" hidden="true"/>
        
        <field name="CODE" title="MYDS">
          <validators>
            <validator type="serverCustom">
              <serverCondition>
                 $dataSource.fetch({
                    "_constructor":"AdvancedCriteria", 
    		"operator":"and", 
    		"criteria":[
                        {
                           "fieldName":"MYDS_ID",
                           "operator":"notEqual", 
                           "value":$record.MYDS_ID 
                        },
                        { 
                           "fieldName":"STATUS",
                           "operator":"equals", 
                           "value":"A" 
                        },
                        {
                            "fieldName":"CODE",
                            "operator":"equals", 
                            "value":$value 
                        }
                     ]
                }
             ).size() == 0
          </serverCondition>
          <errorMessage>Duplicate MYDS values are not permitted.</errorMessage>
            </validator>
            <validator type="required"/>
          </validators>
        </field>
        <field name="TITLE" title="MYDS Title">
          <validators>
            <validator type="required"/>
          </validators>
        </field>
        <field name="STATUS" type="enum" length="1" canEdit="false">
          <valueMap>
            <value id="A">Active</value>
            <value id="P">Pending</value>
            <value id="H">Historical</value>
          </valueMap>
        </field>
        <field name="EFF_DATE" title="Effective Date" type="date"/>
        <field name="THRU_DATE" title="Through Date" type="date"/>
        <field name="SORT_ORDER"/>
        <field name="COMMENTS" detail="true"/>
      </fields>
      <operationBindings>
         <operationBinding operationType="add" requiresRole="ADMIN"/>
      <operationBindings>
    </DataSource>

    #2
    We've never seen this before. We can't see any plausible mechanism except somehow having two copies of your DataSource file around, where one lacks the serverCondition, and is somehow being copied into the test deployment. Might be something weird that your IDE or build scripts are doing.

    Being able to see the server logs for the request might allow us to help further. Note, that's the most important diagnostic to share for a server issue.

    Comment

    Working...
    X