Add phone functionality to the app

You can generate the code to interact with the mobile device's features. This example shows how to call a selected phone number from the app.

  1. Open the appflow.4ba file.
  2. Right-click on the BA diagram and select New > Phone.
  3. Right-click on the Form entity and select Add Relation To. Drag the relation arrow and drop it on the Phone entity.

    Screenshot of 4ba with phone entity related to form entity.
  4. Select the relation between the Form and the Phone entity and set the Action property to callContact. Set the Phone Number property to the phone column (

  5. Save your changes to appflow.4ba.
  6. Double-click on the Form entity to open it in Form Designer. Add a button that triggers your callContact action.
    1. To make room for the button, expand the grid that contains the form fields.
    2. Select Widget > Button.
    3. Draw a button onto your form.
    4. Set the name property of the button to callContact. The name of the button is also the action to be triggered by the button.
    5. Set the text property of the button to Call Contact.

  7. To preview your form, select Build > Preview.
  8. Select File > Save all.
  9. Return to the appflow.4ba file. Right-click the Main program entity and select Execute Program.
    This rebuilds and executes your program in one step.
  10. To test, click the Call Contact button.

    The sample data in the phone field is not a valid phone number. You can enter a real phone number using the device or emulator touch pad.

    Screen shot of changing phone number and dialing.