Checkbox on a lookup form

I added a checkbox to my lookup form and every time I click on the checkbox, it closes the lookup form! I can’t even get it to just check and uncheck properly. Is there something I need to do in order to be able to check the checkbox on the lookup form without the form closing? Does it think I’ve selected something and that value needs to return to the field in the dropdown?

Help!

Thanks!

That’s how lookups work - a lookup is opened, you click something, lookup is closed and the value send to the calling control.

What you need to do is overwrite closeSelect() method in your lookup form. If you don’t call super() there, the form won’t close. So you need to implement some logic to call super() if the form should be closed and skip it otherwise. How this will be decided depends on your requirements.

You can find several examples of this approach in standard AX - for example InventLocationIdLookup form uses checkboxes too - just look into its code.

can i have the code please ??

And why exactly you can’t open the InventLocationIdLookup form in your AX?