The following two examples demonstrate how to fetch data from a form and use it in another form. To do so, a relationship has to be established between the two forms. This is achieved by using Lookup fields.
The sample application named Collection Variable, demonstrates the usage of the Fetch Records task to fetch records from a Form and use it for calculation in another form. This application has two forms:
Note:
In the On User Input block of Customer Field in Form B
if (input.Customer != null)
{
if (input.Commission != null)
{
dat = FormA [ID == input.Customer];
input.Total = (dat.Salary + input.Commission);
}
}
In the On User Input block of Commission Field in Form B
if (input.Commission != null)
{
dat = FormA [ID == input.Customer];
input.Total = (dat.Salary + input.Commission);
}
The records related to the above specified criteria is fetched from the Form A and stored in the collection variable dat.
The Salary field of fetched record is added to the input of the Commission field and the result is displayed in the Total field.
The application “Copy Records” comprises of the following two forms – Leads and Clients. Leads form with fieldsName – Phone – Email to enter the Lead details. Clients form with fields Name – Phone – Email – Address to enter the Client details. When a lead becomes a client, the lead details are updated in the Client table. This is achieved by adding a custom action button to each record in the Leads view. Selecting the button will invoke a function to add the specific record to the clients form.
Deluge Script
1. Add a function to copy the record from the Leads form to the Clients form. The function copyRecord is added to the Script -> Functions tab. This function is invoked when you click on the Copy to Client custom action button.
2. Configure the above function as a custom action in the Leads view. Select Views ->Leads View ->Custom Actions and specify the name of the action as Copy to Clients and click on show action for each record. Specify the required values and click Done.
Learn how to install the application to your account - click here.