How to return a newly created object 2 to an object 1?

1
In a form for object 1 I want to select an object 2. If the object does not exist, I want to create the object 2. The newly created object 2 now should be returned to object 1 as the selected object 2. I added a new button to a select form and now I'm able to create the object 2. My problem is that I'm not able to mimic a select action from the Select form. The Select button is returning an object 2 to object 1. How can I mimic that behaviour after creating the new object 2? It would be sufficient to have the newly created object showing up in the Select form, preferably highlighted (selected), that way the user's only extra action is to click the select button. In my case the list of objects 2 is pretty long (100+), I don't want the user having to scroll down the pages to search for the newly created object. Are there ways to achieve this? ===== More info ===== Here is the situation: From form A with object 1, I want to select an object 2. Opening the select form, I can select an object 2 that's then shown in form A as the selected object 2 - now I have the reference I need. How can I use a MF button to return a newly created object 2? I tried, in a MF creating the new object 2, closing the select form and having the MF return object 2. It didn't create the reference from object 1 to object 2, like the clicking the select button in the select form. I didn't see how to mimic that behaviour. ===== Question from Achiel ===== Are you triggering the MF from a dataview with object1? If so, I believe you get object1 as a parameter, which you could then use to set the reference.
asked
4 answers
1

It sounds like you're looking for a before-create microflow....?

If not, how about using a microflow button instead of a select button?

answered
1

I am not sure what you mean are you using a reference set or a reference selector?

If you are using a reference set then i would suggest to file a feature request that allows one to return an object on save/select.

If you are using a normal reference than you can use the input reference selector from the appstore in combination with a microflow button next to the drop down. The input reference selector allows you to search better in a long drop down list while the microflow button will enable you to create new objects if they are not present.

If the object 2 that you need is not present in the drop down you can create one by using a microflow that automatically links object 1 from which you called the create function to the new object 2 and then you open object 2 inside a dataview of object 1 that contains a dataview of object 2.

answered
1

You could just close the select form when the new button is clicked, add the newly created object to the reference(set) and refresh the object so that it shows up in the original form for object A.

answered
1

Here is the situation: From form A with object 1, I want to select an object 2. Opening the select form, I can select an object 2 that's then shown in form A as the selected object 2 - now I have the reference I need. How can I use a MF button to return a newly created object 2?

I tried, in a MF creating the new object 2, closing the select form and having the MF return object 2. It didn't create the reference from object 1 to object 2, like the clicking the select button in the select form. I didn't see how to mimic that behaviour.

The problem with this architecture is that there is no way to remember what your object A was when you close the select form. That is you close the select form and then your newly opened form will return an Object B but it has no way of knowing where to return it to.

Thus you need one way to remember what your current Object A is. Usually this can be achieved by creating a form with a dataview of Object A that contains nothing but a datagrid of Object B Where you can create/edit/delete/select and Object B.... But in this case you won't be able to use this because a select form needs to be a single datagrid of the entity Object B.

Thinking more about this problem i am not sure if you are currently able to solve this decently. The only solution that comes to mind is to create a separate TempCurrentObject entity that has a reference to every object that you want to keep in context. When you open your Object A you also create a reference from your TempCurrentObject to the current Object A. The rest stays the way it currently is, except for the part where you return your object B. Instead of returning it you retrieve the current Object A from your Temp_CurrentObject entity from the database and then you add Object B to the reference of Object B.

This might seem a (bit) ugly but it will do the trick :p

answered