<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged detail-menu</title>
<link>https://overflow.efficy.io/?qa=tag/detail-menu</link>
<description>Powered by Question2Answer</description>
<item>
<title>Create a conditionnal DetailMenu</title>
<link>https://overflow.efficy.io/?qa=4302/create-a-conditionnal-detailmenu</link>
<description>&lt;p&gt;Hello, &lt;/p&gt;

&lt;p&gt;We would like to customise Efficy in order to have a &lt;code&gt;DetailMenu&lt;/code&gt;, with a condition in it.&lt;/p&gt;

&lt;p&gt;The macro is the following one : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DetailMenu..Docu {[&amp;lt;%GetPopupMenu(id=&quot;detail-menu&quot;, class=&quot;has-icons small&quot;, ulargs='data-channel=&quot;detailmenu&quot;', count=&quot;6&quot;,
text1=&quot;Edit #DETAIL&quot;, image1=&quot;i-edit&quot;,
message1=&quot;edit;{dropdownKey};#DETAIL&quot;,
text2=&quot;Delete #DETAIL&quot;, image2=&quot;i-delete&quot;,
message2=&quot;deleteItem;#DETAIL;{dropdownKey}&quot;,
text3=&quot;Edit Relation&quot;, image3=&quot;i-link&quot;, onlinehelp3=&quot;e110_linkitems&quot;,
message3=`%%IfCategories(then=&quot;editRelation;#ENTITY;#KEY;#DETAIL;{dropdownKey}&quot;)`,
text4=&quot;Duplicate #DETAIL&quot;, image4=&quot;i-Dupl&quot;, onlinehelp4=&quot;e110_duplicateitems&quot;,
message4=&quot;duplicate;#DETAIL;{dropdownKey}&quot;,
text5=&quot;Mark as Handled&quot;, image5=&quot;i-done&quot;,
message5=&quot;markDocumentHandled;{dropdownKey};0&quot;,
text6=&quot;Convert to Opportunity&quot;, image6=&quot;i-Oppo&quot;, rights6=&quot;Oppo&quot;, onlinehelp6=&quot;e110_convertitems2salesopp&quot;,
message6=&quot;convertToEntity;Oppo;#DETAIL;{dropdownKey};Comp\\;Cont\\;Proj\\;Prod;true;NAME&quot;
)%&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;What I would like to do is detect the reference or a field value of the document to propose other options.&lt;br&gt;
But the dev on this cannot make it work.&lt;/p&gt;

&lt;p&gt;He tried this, but it does not seems to work &quot;efficiently&quot; (it always show the option, whatever the reference)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DetailMenu..Docu {[
&amp;lt;%GetPopupMenu(
id=&quot;detail-menu&quot;, class=&quot;has-icons small&quot;, ulargs='data-channel=&quot;detailmenu&quot;', count=&quot;7&quot;,
text1=&quot;Edit #DETAIL&quot;, image1=&quot;i-edit&quot;,
message1=&quot;edit;{dropdownKey};#DETAIL&quot;,
text2=&quot;Delete #DETAIL&quot;, image2=&quot;i-delete&quot;,
message2=&quot;deleteItem;#DETAIL;{dropdownKey}&quot;,
text3=&quot;Edit Relation&quot;, image3=&quot;i-link&quot;, onlinehelp3=&quot;e110_linkitems&quot;,
message3=`%%IfCategories(then=&quot;editRelation;#ENTITY;#KEY;#DETAIL;{dropdownKey}&quot;)`,
text4=&quot;Duplicate #DETAIL&quot;, image4=&quot;i-Dupl&quot;, onlinehelp4=&quot;e110_duplicateitems&quot;,
message4=&quot;duplicate;#DETAIL;{dropdownKey}&quot;,
text5=&quot;Mark as Handled&quot;, image5=&quot;i-done&quot;,
message5=&quot;markDocumentHandled;{dropdownKey};0&quot;,
text6=&quot;Convert to Opportunity&quot;, image6=&quot;i-Oppo&quot;, rights6=&quot;Oppo&quot;, onlinehelp6=&quot;e110_convertitems2salesopp&quot;,
message6=&quot;convertToEntity;Oppo;#DETAIL;{dropdownKey};Comp\\;Cont\\;Proj\\;Prod;true;NAME&quot;,
`%%OnField(&quot;MakeNCG&quot;, query=&quot;select CASE WHEN /*doc.REFERENCE LIKE 'DRAFT-%' OR */doc.REFERENCE LIKE 'NC-%' OR doc.id_kleos IS NOT NULL OR doc.F_INVOICE_STATUS &amp;lt; 4 THEN 0 ELSE 1 END AS MakeNCG from DOCUMENTS doc where doc.K_DOCUMENT = {dropdownKey}&quot;, value=1, then=&quot;text7=`Make NC Globalazzz`, image7=`i-edit`, message7=`NCGlobal;{dropdownKey}`&quot;, else=&quot;text7=`Make NC non`, image7=`i-edit`, message7=`NCGlobal;{dropdownKey}`&quot;)`
)%&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I suppose there is a way to : &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make this &quot;clean&quot;&lt;/li&gt;
&lt;li&gt;Avoid a SQL query&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regards, &lt;/p&gt;

&lt;p&gt;Loïc&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4302/create-a-conditionnal-detailmenu</guid>
<pubDate>Sun, 19 May 2019 12:05:15 +0000</pubDate>
</item>
</channel>
</rss>