with( local!checkIds: fn!index(a!queryEntity( entity: cons!ABC_CHECK_DS, query: a!query( selection: {}, logicalExpression: a!queryLogicalExpression( operator: "OR", filters: { a!queryFilter( field: "effectiveDateTime", operator: ">=", value: todatetime(today()) ) } ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "id", ascending: true ) ) ) ).data,"id", {0}), local!entities: a!queryEntity( entity: cons!ABC_AMOUNT_DS, query: a!query( filter: if( rule!APN_isEmpty(local!checkIds), null, a!queryFilter( field:"checkid", operator:"in", value: tointeger(local!checkIds) ) ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1 ) ) ).data, /* * Construct an HTTP response that contains the information that we just stored * in "local!entities". */ a!httpResponse( /* * Set an HTTP header that tells the client that the body of the response * will be JSON-encoded. */ headers: { a!httpHeader(name: "content-type", value: "application/json") }, /* * JSON-encode the value of "local!entities" and place it in the response body. */ body: a!toJson(value: local!entities) ) )