Fetching Records by ID if search key from URL is String
Hi,
I'm new to Zoho Creator and tried to solve this by digging through the available explanations and posts for quite a while, but I have to admit now that I'm stuck.
This is my setup:
Form A and Form B contain records of different types of products with some details.
In Form C, I select a product from B and assign multiple records from A to it in a subform.
Now, I want to offer a search:
The user selects a product from B from a dropdown, hits a button and should see
- product details for the selected record from B
- any subform records from C matching the selected record
- details from Form A for every listed subform record
Everything works up to the point of displaying the search results. A stateless form MTP_Search shows the dropdown for the user to select the record from B. The ID for this record is then handed over as search variable in the openURL statement.
This search key is now a string, so I cannot easily fetch data from B by matching it to the ID of form B records. I found some posts mentioning to use .toLong() in this case, so I tried
searchname_long = input.searchname.toLong();
without any other statement in the page to test it.
I get this on accessing the application:
"Error details:
Error in executing SearchResult view script.
Error.
Error in executing Set Variable task. Unable to update template variable searchname_long.
Error evaluating NUMERIC expression :"
Sooooo.... how can I identify and fetch records by using the searchname and comparing it one way or another to the ID?
Any help is very much appreciated!
Regards,
Ilka
==========
~Update~
I figured it out in the meantime. Previously, I tried to save the input to a variable and compare this variable to the autonumber / ID.
Now, I use this and it delivers the result I need:
<variable> = Form [Form.autonumber == input.searchname.toLong()];