a!localVariables( local!locationsList:rule!AT_getAddresses(addressId: null), -- getting an error at this line.{ a!sectionLayout( label: "Address", contents: { a!radioButtonField( label: "Radio Buttons", labelPosition: "COLLAPSED", choiceLabels: local!locationsList, choiceValues: local!locationsList, saveInto: {}, choiceLayout: "STACKED", validations: {} ) } )})
Discussion posts and replies are publicly visible
This issue appears to be in the rule itself. Need more information about that rule including the rule inputs and the code.
Hi,
Please find the attached rule info. Thanks for your ack.
a!localVariables( local!queryResults: a!queryEntity( entity: cons!AT_DSE_ADDRESS, query: a!query( paginginfo: a!pagingInfo(1, -1), logicalExpression: a!queryLogicalExpression( operator: "AND", ignoreFiltersWithEmptyValues: true, filters: { a!queryFilter( field: "addressId", operator: "in", value: ri!addressId ), } ) ) ).data, cast( typeof({'type!{urn:com:appian:types:AT}AT_address'()}), local!queryResults))
In the first code you entered the `addressId` as NULL. Was this just for posting here or is it genuinely NULL? With Ids entered do you still have the issue?
Also, is there an `address` field in the AT_address CDT? If so, what is the data type in both the CDT and the database?
--- I am still getting an error message if I replace NULL with any value.
-- There is no 'address' field/column in the AT_address CDT.
Can you post a picture of the rule inputs for the rule!AT_getAddresses() rule?
AT_getAddresses() is working fine when I test.
Please find the attached screen shot with test output.
I have re-written the object and when I try to test the expression rule with parameter then I am getting an error.
Without any parameter, I am able to get the result. Not sure what is causing the error in above case.
I'm struggling to find the address rule input. It has to be somewhere but it's not in anything I've seen yet. As the error has Rule Input "address" in it and it's a casting issue I really need to find this parameter.
I've re-created your code but have substituted the query rule with hard coded dictionary and it works. If you copy and paste my code, does it work for you?
Finally, does the interface you're working in have an `address` rule input? Does anywhere have an `address` rule input?
a!localVariables( local!locationsList: { { addressId: 1, shippingAddress: "47 New Saddle Ave", unitNumber: null, city: "Goose Creek", stateOrProvince: "SC", postalCode: 29445 } }, { a!sectionLayout( label: "Address", contents: { a!radioButtonField( label: "Radio Buttons", labelPosition: "COLLAPSED", choiceLabels: local!locationsList, choiceValues: local!locationsList, saveInto: {}, choiceLayout: "STACKED", validations: {} ) } ) } )
AT_Address_CDT -- Custom Data Type
AT_DS -- Data Store
Constant -- Pointing to DSE
Expression Rule:
I have copied all the code/setup screen shots. I am getting an error when I try to test Expression Rule with any parameter value. I am hoping something is wrong in casting in expression rule itself.
If `addressId` isn't an array then you can't use "in" within your a!queryFilter() rule and you need to use "=".
But that wasn't the original issue (I don't think!)
In the below line of code if I use numbers like 1 or 2 or 3 I am getting an error. Otherwise, if I use below syntax no issues.
local!locationsList: rule!AT_getAddresses_ER(addressId: null)
Thanks for your quick responses.
To confirm, have we got it partly solved and the last error remaining is using any number in your query rule?
Yah, it is partly solved.