Best practice select or add relationship record

I am looking for guidance on best practice implementation of the pattern, typical in a CRM, of being able to browse in a combo box a related entity (such as contacts from an account record) and having an easy option to choose from the list or add a new contact and in either case have the contact name displayed and chosen in the combo box. It looks like I want to add an entry like "Add a contact" as a special list item and then popup a window to add a new contact when that is chosen. Am I on the right/best track here. If so then can the newly created contact appear in the combo box when I return from the add contact popup or will it have to be selected.

William,


What you have suggested is one of the ways to go. Use the special value in the combo box and have the add option. Yes. You can have the combo box show the new value after you save it. The steps would be to refresh the database query that is populating the combo box and then do an ajax refresh on the combobox itself.


stacey

Solution

Stacey Levine wrote:

William,


What you have suggested is one of the ways to go. Use the special value in the combo box and have the add option. Yes. You can have the combo box show the new value after you save it. The steps would be to refresh the database query that is populating the combo box and then do an ajax refresh on the combobox itself.


stacey

Great, thanks Stacey. Also could you give me an example of the if to test for the special?

Solution

You put the value in. So when you create the special variable, you put the text and the value. So just check for whatever value you assign.