Refresh Lookup field with the value that is created from create action of lookup field

Hi,
I am having table named products and productgroup . The productgroup is an association in products table. I have added a create action to productgroup column in products table to add a new productgroup if it is not avilable in the lookup. The Lookup field is not refreshed after the action commit so the lookupfield doesnot get updated with the recently added productgroup. How can i refresh the lookupfield after the create action is performed ??

Thanks and Regards…!

Is it possible ??

Hello, @stephy
Please send a test project with your problem.

Regards,
Mariya

Hi
How to attach a project because I dont have any git repository ??
@sukhova

Are you using IDEA?
If yes, then open from menu File->Export to Zip File

Regards,
Mariya

Lookup_refresh.zip (83.3 KB)

Hi ,
I have attached the sample project.
I need to get the recently added product group from the lookup “+” action to the product group lookup.

@sukhova

Thanks and Regards…!

Hi,
any suggestions ??
@sukhova

Hello!
Please, try this in your addNew() method:

        final Editor productGroupEditor = openEditor(
                "lookuprefresh$ProductGroup.edit", metadata.create(ProductGroup.class), WindowManager.OpenType.DIALOG
        );
        productGroupEditor.addCloseListener(actionId -> {
            productGroupsDs.refresh();
            productGroupField.setValue(productGroupEditor.getItem());
        });

Regards,
Mariya

It worked.
Thank you so much @sukhova :slight_smile: