When creating your own custom app, sometimes you may want the user to create a contact. This will take the user to the Customers & Leads App where they create the user.
However, when they have finished creating the new contact, the Customers & Leads App will not redirect the user back to your custom app. Furthermore, the custom app will not know the Record ID of the newly created contact.
Solution: The Customers & Leads App will always check for a shared result called resultGoBack
. If this is set to "Yes", on completion of a newly created contact, the Customers & Leads App will go back to the calling app, and it will store the Record ID of the new contact in a shared result called resultContactRecordIDfromNewContact
.
Details
You do not have to customize the New Contact screen at all. If the shared result resultGoBack
is set to "Yes", the New Contact screen will look for this flag and follow these steps:
Hide the "Save & New" button.
Clear the shared result
resultGoBack
.On Save, the user is taken back to the screen that the user came from (your screen).
The record ID of the newly created contact is stored in the shared result
resultContactRecordIDfromNewContact
.
Example
In this example, a Custom App has a drop down to choose a contact. In the drop down, there is custom row to Add/Edit a contact.
In the event "Custom Row Click" of the Contact dropdown, we use the action "Assign Value to Shared Result" to set the shared result
resultGoBack
to "Yes". Make sure the type is "Yes/No".
βIn the screen's properties, you will need to add a few actions to the "Focus" event. The record ID of the newly created contact will be stored in the shared result
resultContactRecordIDfromNewContact
.Check conditional statement:
resultContactRecordIDfromNewContact
is not empty.
βIf above statement is true, update dropdown control with
resultContactRecordIDfromNewContact
.
βClear
resultContactRecordIDfromNewContact
else you may cause unexpected bugs.
βCall Change Event of dropdown control if it has actions when a contact is selected.