6. Dependencies

Objective :
We’ll create our final module that leverages the “Field Dependency” feature provided by PrimeApps. Dependencies enable changing the behavior of certain fields depending on the status of other fields.
Time: 5 mins

Our Service Desk app needed 3 modules: We already created Customers and Technicians. Let’s now create the Service Requests module:

  • 1. Go to Model Modules.
  • 2. Click on + New Module.
  • 3. Click on Settings. Type in the following:
    • a. Singular Name: Service Request
    • b. Plural Name: Service Requests
    • c. Select an icon you like.
    • You can leave the rest of the fields untouched.
  • 4. Click Save.

Now you’re ready to define the individual fields for Service Requests::

  • 5. Drag-n-drop Number (Auto) into the General pane. Type in the following:
    • a. Field name: ID
  • 6. Check Make Primary option.
  • 7. Click Save.

We now identified the field ID as the primary. We now can go ahead and delete the default Name field:

  • 8. Hover over the Name field and click on the trash bin icon to delete it.

Now let’s create other simple fields for Service Requests:

  • 9. Drag-n-drop Text (Single Line) to create a field named “Description”
  • 10. Drag-n-drop Date/Time to create a field named “Start Time”
  • 11. Drag-n-drop Date/Time to create a field named “End Time”

It’s time to create the lookup fields:

  • 12. Drag-n-drop LookUp into the General pane.
    • a. Field name: Customer
    • b. Lookup Type: Customer
  • 13. Click Save.
  • 14. Drag-n-drop LookUp into the General pane.
    • a. Field name: Responsible Technician
    • b. Lookup Type: Technician
  • 15. Click Save.

In our scenario, every service request needs to have a Status field with the following items: New, Assigned, In-Progress, Resolved, Cancelled. In our previous scenario, we mentioned that these predefined lists are called “picklists”. Let’s create a new “Service Request Status” picklist:

  • 16. Go to Model Picklists.
  • 17. Click on + New Picklist.
  • 18. On the Name field, type in “Service Request Status”
  • 19. Click Save.
  • 20. Click on the Service Request Status picklist to edit the list. Type in the following items:
    • a. New
    • b. Assigned
    • c. In-Progress
    • d. Resolved
    • e. Cancelled
  • 21. Click Save Sort Order.

We now will use this new picklist in our Service Requests module:

  • 22. Go back to Model Modules.
  • 23. Click on the module Service Requests
  • 24. Drag-n-drop Pick List into the General pane. Type in the following:
    • a. Field name: Status
    • b. Picklist: Choose our previously created picklist “Service Request Status”
  • 25. Click Save.

We created all the fields we need in our Service Requests module. However, we would like to see a certain behavior on our fields to better represent the lifecycle of a service request:

  • Whenever “Status” becomes “Assigned”, “Responsible Technician” and “Start time” fields should become visible.
  • Whenever “Status” becomes “Resolved” or “Closed”, “End time” field should become visible.

In order to achieve this behavior, we need to establish a Field Dependency among the fields:

  • 26. Go to Model Dependencies.
  • 27. Click on + New Field Dependency.
  • 28. Enter the following:
    • a. Module: Service Requests
    • b. Type: Display
    • c. Parent Field: Status
    • d. Child Field: Responsible Technician
  • 29. Click Save.
  • 30. Create another Field Dependency:
    • a. Module: Service Requests
    • b. Type: Display
    • c. Parent Field: Status
    • d. Child Field: Start Time
  • 31. And one final one:
    • a. Module: Service Requests
    • b. Type: Display
    • c. Parent Field: Status
    • d. Child Field: End Time

And you’re done creating all your 3 modules. Now let’s move to creating relationships among these modules: