Creating SubForms in Zoho Creator

Feb 10 2009 09:27:32 PM Posted By : Latha
Comments (10)

We received several requests from our users on the subform functionality in Zoho Creator. Subforms is certainly in our High Priority list and will be available in the near future. As a workaround, we have put up a sample application that provides the subform functionality (accessing subform within the mainform), using Deluge Scripting. 

About the Meeting Tracker Application

The Meeting Tracker application comprises of the following forms:

1. Add Meetings - the master form to enter data about each meeting as shown below.

2. Add Meeting Attendance -  the subform to enter attendees for each meeting. This sub-form will be invoked from the Meetings View by selecting the button as shown below.

  • The attendance details for each meeting can be viewed by selecting the  button, as shown below.



Steps to configure the Add Attendance
and View Attendance custom action buttons

Now let us learn how the custom buttons Add Attendance and View Attendance are added to the Meetings View. The Add Attendance and View Attendance are called custom action buttons.  "Custom Action" is a feature integrated in ZC Views to enable users to invoke a specific user-defined Function on selected records in a view.

In this application,  "Add Attendence" custom action invokes the function that will display the "Add Meeting Attendence Form" . Similarly, the "View Attendance" custom action invokes the function to display the Attendance view.

(The same steps can be followed to configure the View Attandance custom action, to view the attendance for each meeting).

a. Defining the Function:

1. Select Script -> Function tab and define a new function by selecting the New button.

2. In the Function dialog, specify the function name, namespace, return type and arguments to be passed to this function. In this example, we define a function named "addattendance" that will display the "Add Attendance" form for the selected record in the view. Hence, return type is specified as void and the record id is passed as argument to the function.

3. Click Done to add the function.

4. Drag-n-drop the Open URL deluge task to the editor-area.  The OpenUrl task redirects the form to a specified URL. Specify the URL string as given in the application.  In the the url string specified,

((((("http://creator.zoho.com/";;;;; + zoho.adminuser) + "/") + zoho.appname) + "/form-embed/Add_Meeting_Attendance/meetingid=") + input.id) + "",

- Add_Meeting_Attendance  - is the name of the form to be displayed
- meetingid  - is the name of the field in the Add_Meeting_Attendance form
- input.id - id is the function argument which will pass the value of the selected record ID and update it in meetingid.

5. Click Save Script to update the changes.

 

b. Configuring the function "addattendance" as Custom Action in the Meetings View

1. Select Views -> Meetings and click on Custom Actions from the left-side tree.
2. Specify the Action Name, the action display type and the function to be configured.
3. Click Done to update the changes.


The above configuration will add the Add Attendance custom action button to each record in the Meetings View. When the button is clicked, the form Add Meeting Attendance is displayed for the selected meeting.

To view the Functions and the scripts added to the application,

  • Copy the application by selecting More Actions -> Copy Application link displayed in the top-right corner. The application will be copied to your account and displayed in your Home page as "Copy of Meeting Tracker".
  • Select the Edit button and click on Script -> Function tab to view the functions added to the application.
  • Click on Script -> Form tab and select the the Add Meeting Attendance from the Form drop-down box.. The "on add -> on load" script is added to this form to display the Meeting name of the selected meeting in the Pick Meeting list-box.
Related Links:

Help Doc -> Deluge Reference -> Functions and Custom Action.
Help Doc -> Deluge Reference -> Open URL

Comments

Post Comment