Creating Reparent Popup

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I want to build a button from a record detail page (OldParent) that takes the following actions:

1. Allow the user to search for another record of the same type in a popup window.
2. Allow the user to select the record (NewParent) and click Close Duplicate.
3. Update the OldParent reference field on OldParent child records from OldParent.Id to NewParent.Id
4. Update OldParent Status to "Duplicate"

I can do everything but step 3. How to I get the Id value from NewParent? I'm new to the Search component, so if there's a way to use the search results, I'm missing it.

Thanks for any help you can provide.
Photo of Shane Steele

Shane Steele

  • 220 Points 100 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,512 Points 10k badge 2x thumb

Instead of using the Search Component, how about a pop up with a Field Editor, a custom button to Search and a Table below the editor and button.  You add whatever fields you want to search by in the Field Editor, add actions to activate and set model conditions using the field contents, and return results in the table.  You just need to add a row action to get the Id, close the popup and update your original page.


Photo of Shane Steele

Shane Steele

  • 220 Points 100 badge 2x thumb

Interesting thought. I've made some progress with the search component, but I'll try your approach, too. Thanks for the idea.