top of page

Moji5 Knowledgebase

Retrieving data from another form

Problem


You have two forms:

  • Customer form (containing customer information)

  • Invoice form


When you launch the invoice form, you would like to have a drop down list to pick a

customer. When you have selected that customer, you want the other details of this

customer (such as phone number, address) to appear below the drop down list (in the

fashion shown below).


Solution

Setting up the sample:

1. Create a form called "Sample Customer"


2. Publish this form and key in some sample customer records.

3. Now create another form named "Sample Invoice". In this form, you want to

select the customer from a drop down list, and then retrieve the selected

customer's phone number, e-mail address and address from the "Sample

Customer" form.

4. In the "Sample Invoice" form, create a dropdown field named "Bill to Customer".


5. Set its type to "Dynamic Source". Choose "Sample Customer" as the source

form, and set its Caption & Order field to "Customer name". Then click Create field.
























6. Create 3 more label fields named "Address", "Phone Number" and "E-mail

address" and add them to the form in this fashion:



The solution:


1. When you change the customer in the "Bill to customer" drop down list, you want the Address, Phone Number and E-mail address to be filled in for that particular customer.

2. In the same "Sample Invoice" form, click on "Edit form behavior".


3. Click Create new behavior.


4. Name your behavior as "Retrieve Data" then click on the Action wizard.



5. Click on the Create an action button.



6. Choose the Read from other form action.



7. In the ensuing page, ensure "From dropdown" is selected. Set the "Drop-down"

field to "Bill to Customer".

8. The Form query results field will instantly refresh to show all the fields in the

"Sample Customer" form (the form referenced by "Bill to customer")



9. The field on the left (highlighted in red below) represents the field on the current

form ("Sample Invoice") that you would like to use to display the retrieved data.

10. For example, select "Customer address" in the "Form Query Results" field. You

you grab this value and display it in the "Address" field on the current form. (See

attached screenshot below)



11. Once you have done that, click on "Add Assignment". This assignment will be

added into the list box below. Repeat these steps for the E-mail address field and

the phone number fields.

12. You should have the following items in your listbox at this point:



13. Click on the OK button, and click Save changes in the next window.



14. You should be able to see a summary of the behavior you have created so far:



15. Now click Create now to create the behavior.

16. Publish your "Sample Invoice" form.


Testing your solution:

1. Run the application & launch the form.

2. Change the "Bill to customer" drop down.

3. The Address, Phone Number and E-mail address should be automatically

displayed for that customer.




Comentarios


bottom of page