FTS links to Parent entity

I have a Parent Entity “Person” and 3 extended “Customer”, “Employee” and “Dealer”.
Searching from FTS, lets say a “name”, the result list shows “Persons” entities. Is there a way to open the correspondent extended entity editor when I click on a parent link at the FTS result list?

Got a solution here.

Now, I need to find a way to read discriminator value…

I found a solution. Not very elegant, but it works for me.

public class ExtSearchResultsWindow extends SearchResultsWindow {

    protected void openEntityWindow(SearchResult.Entry entry, String entityName, WindowManager.OpenType openType) {
        WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME);
        MetaClass metaClass = metadata.getSession().getClass(entityName);
        Entity entity = reloadEntity(metaClass, entry.getId());
        if (entityName.equals("myapp$Person")) {
            if (entity.getClass().getName().contains("Employee")) {
            } else if (entity.getClass().name.contains("Customer")) {
            } else {
            metaClass = metadata.getSession().getClass(entityName);
            entity = reloadEntity(metaClass, entry.getId());
        openEditor(windowConfig.getEditorScreenId(metaClass), entity, openType);


Refer for another solution

1 Like