11: Go to contact

We’ve made a big deal about apps “talking” to one another in the Method environment. Wouldn’t it be handy if a user could get to a driver’s View Contact screen just by clicking on their name?  It sure would, so let’s set it up.

Add GoToContactName

  1. From your Edit Car screen, click Customize.
  2. Within the SectionHeader, drag a section into the right cell. This new section will actually be INSIDE the SectionHeader. Think of it as Method Inception.
  3. Select this Section and title it “SectionHeaderTitle
  4. Uncheck “Show Header/Title bar” to make sure your users won’t see it.
  5. Drag the NewEditCar text object out of the SectionHeader and into SectionHeaderTitle.
  6. Add a new row to SectionHeaderTitle by clicking the Rows + icon.
  7. Drag a new text object into the lower row of SectionHeaderTitle.
  8. Select the text object and change the text to “GoToContactName
  9. Change the Load State to Hidden because we don't want this to show up when adding a new car.
  10. Check show icon for this text object and find the Right Chevron.
  11. Change the Icon Alignment to Right.

[top]

Go To Screen Action

And now, let’s add the action to GoToContactName object!

  1. Click the down arrow on the GoToContactName text object and select Click.
  2. Add the action Go To Screen.
  3. For Screen/History, choose Contacts >> View Contact.
  4. For Screen Record ID, choose Has Specified Active Record ID.
  5. For Specify Active Record ID, choose Screen - ContactsRecordID - RecordID.
  6. Remember to add an Internal Note - “Go To Contact Screen”.
  7. Then click Save & Back > Save & Close > Save > Close.

When you test the screen while editing a car, you’ll find that clicking the contact name in the header will take you to the View Contact screen for that driver!  However, the caption still says GoToContactName. You know what would be more useful? If it was the actual name of the contact. Let’s set that up! Go back into customizing this screen.

Show Name for Link

Similar to the Delete button, GoToContactName will change if the screen is being used to Edit a car, as opposed to adding a new one. We will need to go back to the Screen's Active Record Change event.

  1. Click the Page Icon to get to the Screen Properties and open up the Active Record Change event.
  2. Expand the existing Conditional Statement.
  3. We need to make GoToContactName visible when we're editing a screen, so within the IF  condition, edit the existing Show/Hide Controls  by clicking the little pencil beside it.
  4. Click + Add Another Controland change:
    • Control*: GoToContactName
    • Option: Show
    • Change Internal Note: "Show Delete button & GoToContactName"
    • Click Save & Back
  5. Add an action below Show/Hide Controls  by clicking the down arrow beside it and choosing Add Action Below.
  6. Select Update Controls on Screen and put in:
    • Control: GoToContactName
    • Value From: Screen
    • Value: ContactsRecordID and keep the default of Display
    • Internal Note: "Update GoToContactsName with Contact Name"
    • Click Save & Back
  7. Click Save & Close to exit the Action List.

Update Link on Change

One final thing, when the Contact is change, GoToContactName should change as well! This will use the Changeevent of the ContactsRecordID dropdown.

  1. Edit the Change Event of the ContactsRecordID field.
  2. Add the action Conditional Statement.
  3. Click the pencil beside the IF statement to set the Condition.
  4. The 1st Value should be set to Screen - ContactsRecordID - Display”, and the Comparison should be “Is Empty”.
  5. Include the Internal Note - "Is Contact Dropdown Empty?"
  6. Click Save & Back.

If a contact is not selected, or if a vehicle doesn’t have an associated contact, we don’t even want the GoToContactName object to be visible. So let’s use the Show/Hide Control action to hide the text object when it’s empty.

  1. Click the down arrow beside IF  and select Add Action Below. Find and select action Show/Hide Controls:
    • Control*: GoToContactName.
    • Option: Hide.
    • Internal Note: "Hide GoToContactName".
    • Click Save & Back.

So now, if the Contact field is empty, the GoToContactName text object is hidden. In the ELSE statement, we can tell Method what to do if the Contact field has a name in it!

  1. Click the down arrow beside Else , Add Action Below, and find Update Controls on Screen.
    • Control: GoToContactName.
    • Value From is where we will get the value to update the control: Select Screen.
    • Value: ContactsRecordID - Display (which is selected by default).
    • Internal Note: "Update GoToContactName with Contact Name"
    • Click Save & Back.
  2. Select the down arrow on Update Controls on Screen and Add an action below this one (to keep it within the ELSE  condition.
  3. Add Action Show/Hide Controls (In case it was hidden before, we need to unhide it now).
    • Control*: GoToContactName.
    • Option: Show.
    • Internal Note: "Unhide GoToContactName".
    • Click Save & Back.
    • Drag and indent the Show/Hide Controls action underneath the ELSE Statement, then click Save & Close.
  4. Finally, Save and Close the screen.

Success!  Method will now display an associated Contact in the Edit Car section, and you’ll be able to click on that contact to open the Contacts app and see the View Contact screen associated with that driver!

[top]

Was this article helpful?

Can’t find what you’re looking for?

Contact Us