• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Load a record from a non-RSForm table into form

Load a record from a non-RSForm table into form 8 years 9 months ago #35511

  • patrick.jackson
  • patrick.jackson's Avatar
  • OFFLINE
  • Junior Boarder
  • Joomla Consultant, Melbourne Australia
  • Posts: 22
  • Thank you received: 4
Here's what I'm in the process of doing... let me know if you'd like more details of how it's done when I figure it out.

Load a record from a completely different table into RSForms Pro

I've created a rather comprehensive RSForm for use with an application tied into Chronoforms. Knowing how RSForms Pro works better than Chronoforms, the form has 80 fields on it, with a range of conditional items and other features that have bells and whistles applied to it.

I've set up the form so now it maps submissions into the Chronoforms table successfully.

The next part of the process is getting the record to load from the Chronoform table into the RSForm. The form is unusual in that it's not modifying the existing record, but instead is creating a new copy of the record. The form itself needs to have previous versions of the record saved for potential referencing if there's an issue - so each record is a version.

One of the main reasons I want to do this is to more cleanly manage the database records by having a flat table rather than needing a lookup process for the values (which is fine for most of the forms, but this table currently has 28000 records from it's previous incarnation on a 1.5 site with a custom PHP interface).

So the How To I'm looking for (or writing myself as I work it out) is how do I go about not just loading a list in for a dropdown (which there are examples of) but how to load a complete record into RSForms.

The steps I think are required:
  • Pass record ID for the table record to be loaded via URL
  • In the Form Properties > PHP Scripts > Script called on form display, PHP needs to be created to grab the URL parameter, then query the database table for the record.
  • This PHP then needs to turn the record into a $form[] array so that it loads the field values into the form.
  • The values should all then appear as the default values when the form loads.

Will post the code to make the array when I have it worked out, but in the meanwhile any tips in the right direction are welcomed.

Patrick
Joomla Consultant & Hosting Provider
Melbourne Australia
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!