Hi Community!
¿How could I change the default value that appears in the column list when I enter the lookup of a custom entity? I want that initially when I open the lookup, I can filter by a field, without changing the display value in the system
In this case, I want the default value to search not be "Nombre y Apellidos" but, another field.
King Regards,
Ezequiel
Like
Dear Ezequiel,
The lookup field values are sorted based on the column that was set to be the primary column in the Configuration. You may go to the lookup in the Configuration and change the primary column to the one you'd like to use and so, the values would be sorted based on it.
Alternatively, you may reach your aim with the help of the development. In this case you need to replace the ‘LookupPageViewModelGenerator’. The column for the search is configured in it in ‘GenerateViewModel’.
Lisa
Dear Lisa,
Thanks you for your response!
I replaced the "LookupPageViewModelGenerator". Copy all text y edit "generateViewModel" function. Code in the image below
in this function I can not use this.callParent (arguments) because? In red marked the customizations that i made to the function.
This in principe works, but for all system lookups the lookup title starts with "undefined". How do I solve that problem?
King Regards,
Ezequiel
Dear Ezequiel,
You need to re-add "CaptionLookupPage" localizable string and re-save the schema. For the changes to be displayed, you also would need to empty the cache and log out and back in.
Lisa
Dear Lisa,
I re-added "CaptionLookupPage" and it worked!
Thanks you!
Regards!
Ezequiel