Subform : Recall existing data into subform - not create new data
My use case is that I have a multi-select field where I want users to be able to choose locations that already exist and bring them into a subform to edit. The subform is linked - not an inline one. The multi-select field and the subform are the "locations" form.
I need to be able to fetch and update existing records, not create new ones
I can get the first part of the code to return the record for the last
option chosen in the multi-select. I just need it to populate (and
thereby link) the existing location record.
- //Use a null check to stop it running if there is nothing to match
- if(location[ID = input.locations].ID != null)
- {
- varLocations = input.locations;
- //create and clear the list as it's run every time something is added to the multiselect
- varCollection = Collection();
- varCollection.clear();
- //Add all the selected locations to the collection
- varCollection.insertall(input.locations);
- //Get the size of the collection (minus a one because it's a zero index)
- varLocationCount = varCollection.size() - 1;
- //Now we just need the ID of the last location chosen
- varLastLocation = varCollection.get(varLocationCount);
- //
- //Fetch the location about the chosen location
- varFetchLocation = location[ID == varLastLocation];
- //
- // Here's where I try to add the fetched location to the subform
- for each row in input.SUB_LOCATIONS
- {
- row.ID = varFetchLocation.ID;
- row.location_name = varFetchLocation.location_name;
- }
- }
Here's a visual example of my desired end result
Sticky Posts
Share your success story
We would like to hear from our passionate users how much Zoho Creator has changed the way you work and benefited you. If you would like to share your story to us and be featured as a proud user of Zoho Creator, then this is for you. Fill up the form below and if you want to be included in a case study, we will get in touch with you to get further details. So what are you waiting for? Tell us your story. Charles
Merge and Store v1 API depreciation
Hi Zoho Writer users, The Merge and Store v1 API allows you to store the merged document in Zoho WorkDrive. The response of this API will be returned with the document's ID only after the merge is complete. In Deluge, the maximum timeout for operation
Zoho Creator Developer's Conference 2017 !!!
We welcome all our Creator Developers! You're invited to join us for our annual Zoholics Developers conference August 29th–31st! This is your chance to get training and guidance on Zoho Creator from our most knowledgeable custom app builders. Zoholics Developers is a three-day event where you'll participate in interactive workshops to hone your app-building skills, get questions answered by Creator experts with personal one-on-one sessions, and connect with other Creator developers from around