0 votes

Has anyone already created a custom search that can :
- be launched from a relation window
- search for a company in Efficy
- use the K_COMPANY of the selected company to fill a field

asked in Efficy/ Client side by (607 points)

2 Answers

+1 vote
Best answer

Hi Stijn

I found an easy way to achieve this, without coding anything in custom. Tried with Efficy 11.2, but it should be working for previous versions as well.

I made a custom field PUBL_CONT.F_COMPANY as followed. You can select lookuptable COMPANIES by an interface hack (with F12) and changing one of the select options to (K_TABLE=10000) and then selecting it. Idem for the field NAME (K_FIELD=2).

Desginer Field Management

Apply structure. Then edit the Publ Cont form. Add the field to the form and be sure to select the LOOKUPDROPDOWNSEARCH definition.

LOOKUPDROPDOWNSEARCH

Then save and presto. Go to Efficy and link a contact to a campaign. In the relation window, you can start searching for a company. It will store the ID automatically.

Search company

Using the field in a queryview will display the company name.

Custom view

It takes a little bit more coding if you want to use the full search dialog. Take a look at the code inside pages/dialog/Duplicate.htm.

function DoSearch(newIndex) {
  index = newIndex;
  Search('<%GetEntity()%>', 'setOpenerEntity;$K');
}

Using the entitypicker is not that complicated also...
Good that it will be part of Efficy 11.3 anyway.

answered by (6.8k points)
selected by
+3 votes

This will probably not really help you in the short term, but in the next Efficy 11.3 there will be an "entity picker" option for fields that needs to store a key to another entity.

Simply use <%GetEdit(type="entitypicker")%> to get access to this marvel :).
You'll not only get a search, but also the recent and favorite list functionality.

answered by (836 points)
It's time to remove the limitation from Designer that we can't select entity tables to serve as lookup table, especially in combination with this type of entitypicker field
super !  That's really handy
1,166 questions
1,424 answers
1,715 comments
325 users