<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged duplicate-query-definition</title>
<link>https://overflow.efficy.io/?qa=tag/duplicate-query-definition</link>
<description>Powered by Question2Answer</description>
<item>
<title>Query Builder with several NAME columns definition ... links are not working</title>
<link>https://overflow.efficy.io/?qa=6353/query-builder-with-several-columns-definition-links-working</link>
<description>&lt;p&gt;Dear All,&lt;/p&gt;

&lt;p&gt;Before Efficy 2021, the &lt;code&gt;pages\dialog\QueryResult.htm&lt;/code&gt; was using the &lt;code&gt;pages\grid\QueryResult.htm&lt;/code&gt; in order to set the columns definitions, now it is using the &lt;code&gt;GridColumns.txt&lt;/code&gt;. And some new GridColumns.txt definitions have been added to try to make the NAME columns clickable by using the new function tag &lt;code&gt;&amp;lt;%IfFromNativeQuery()%&amp;gt;&lt;/code&gt; : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;td.NAME, td.TITLE.Mail, td.SUBJECT {[&amp;lt;td class=&quot;&amp;lt;#I=OPENED;0=inactive&amp;gt;&quot;&amp;gt;&amp;lt;%IfFromNativeQuery(
then=`&amp;lt;#F=$FIELD$;emptytext=T;context=TEXT&amp;gt;`,
else=`&amp;lt;a href=&quot;javascript:View('$ENTITY$','&amp;lt;#F=$KEY$;absent=T;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;emptytext=T;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;`)%&amp;gt;&amp;lt;/td&amp;gt;]}

td.K_CONTACT  {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Cont','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_COMPANY  {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Comp','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_PROJECT  {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Proj','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_DOCUMENT {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Docu','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_PRODUCT  {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Prod','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_PUBLICATION {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Publ','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_OPPORTUNITY {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Oppo','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_CASE     {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Case','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_PROFILE  {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Prof','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_ACTION   {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Acti','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
td.K_MAIL     {[&amp;lt;%IfFromNativeQuery(then=`&amp;lt;td&amp;gt;&amp;lt;a href=&quot;javascript:View('Mail','&amp;lt;#F=$FIELD$;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;`)%&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The issue with this change is that in a simple Efficy Query like below, it is now not possible to click on the Company or Contact name to view it. &lt;strong&gt;This was working in the previous version of Efficy!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Example of a simple Query Builder in order to reproduce this: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[Select]
OPPORTUNITIES.K_OPPORTUNITY
OPPORTUNITIES.NAME
COMPANIES.K_COMPANY
COMPANIES.NAME
CONTACTS.K_CONTACT
CONTACTS.NAME

[From]
OPPORTUNITIES
OPPORTUNITIES OPPO_COMP
OPPO_COMP COMPANIES
OPPORTUNITIES OPPO_CONT
OPPO_CONT CONTACTS

[Where]

[Orderby]

[Options]
ChangeParameters=0
Distinct=0

[InlineEdit]
OPPORTUNITIES.K_OPPORTUNITY{}
OPPORTUNITIES.NAME{}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In order to make it clickable I can add the following aliases ... but then that means we need to review all the queries in the Customer Database which is really a pain in the A** and this may raise issue with existing queries.&lt;/p&gt;

&lt;p&gt;Alias Example:&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=14314080625621442045&quot; alt=&quot;QueryBuilder Alias&quot;&gt;&lt;/p&gt;

&lt;p&gt;I looked a bit in the source of the &lt;code&gt;pages\dialog\QueryResult.htm&lt;/code&gt; and find that the duplicated NAME columns are named NAME&lt;em&gt;1, NAME&lt;/em&gt;2 ... so I tried to add the following  GridColumnsCustom.txt definitions but it seems that the $ENTITY$ is empty!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;td.NAME_1, td.NAME_2 {[&amp;lt;td class=&quot;&amp;lt;#I=OPENED;0=inactive&amp;gt;&quot;&amp;gt;&amp;lt;%IfFromNativeQuery(
then=`&amp;lt;#F=$FIELD$;emptytext=T;context=TEXT&amp;gt;`,
else=`&amp;lt;a href=&quot;javascript:View('$ENTITY$','&amp;lt;#F=$KEY$;absent=T;context=JS,ATTR&amp;gt;')&quot;&amp;gt;&amp;lt;#F=$FIELD$;emptytext=T;context=TEXT&amp;gt;&amp;lt;/a&amp;gt;`)%&amp;gt;&amp;lt;/td&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=13214430766166781672&quot; alt=&quot;QueryBuilder new Definitions&quot;&gt;&lt;/p&gt;

&lt;p&gt;Is there another way to activate the old behavior? &lt;br&gt;
Can we override the &lt;code&gt;pages\dialog\QueryResult.htm&lt;/code&gt; and call the old page &lt;code&gt;pages\grid\QueryResult.htm&lt;/code&gt; or it is not recommended to do it?&lt;/p&gt;

&lt;p&gt;Cf also Submariner ticket &lt;a rel=&quot;nofollow&quot; href=&quot;https://submariners.efficy.com/crm/view/Case/233155&quot;&gt;CFT-2021-190155&lt;/a&gt;&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6353/query-builder-with-several-columns-definition-links-working</guid>
<pubDate>Fri, 12 Nov 2021 13:54:28 +0000</pubDate>
</item>
</channel>
</rss>