<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged macroconsultcustom</title>
<link>https://overflow.efficy.io/?qa=tag/macroconsultcustom</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>
<item>
<title>OnField in a macro for a DetailtabButton is not working</title>
<link>https://overflow.efficy.io/?qa=3593/onfield-in-a-macro-for-a-detailtabbutton-is-not-working</link>
<description>&lt;p&gt;Here is the code in MacroConsultCustom.txt&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;EntityMeusinvestProj@CIDE_SOCRAN{[Time;&amp;lt;%OnField(query='isParentProj', 'nbEnfant', condition='equal', value=0, then=|SumT|, else=||)%&amp;gt;]}
DetailTabsButtons.Proj {[&amp;lt;%IfHasTimeLine(then='Tmln;')%&amp;gt;Cont;Comp;Acti;Mail;Docu;Prod;Proj;Publ;Oppo;Case;Prof;Glry;Memo;Catg;Hist;&amp;lt;%Macro(EntityMeusinvestProj)%&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The Onfield is not working because its in the &lt;code&gt;EntityMeusinvestProj&lt;/code&gt; macro.&lt;br&gt;
If I put the onField outside, directly in the detailTabsButton, its working. But I can't, because I have to show the tabs only for the CIDE_SOCRAN group.&lt;/p&gt;

&lt;p&gt;nb: I can't do like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DetailTabsButtons.Proj@CIDE_SOCRAN{[...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Cause it will erase the DetailTabsButtons for the other groups&lt;/p&gt;

&lt;p&gt;Any idea to go around this problem ?&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3593/onfield-in-a-macro-for-a-detailtabbutton-is-not-working</guid>
<pubDate>Mon, 08 Oct 2018 16:01:32 +0000</pubDate>
</item>
<item>
<title>error after adding custom value to the model</title>
<link>https://overflow.efficy.io/?qa=2824/error-after-adding-custom-value-to-the-model</link>
<description>&lt;p&gt;Hi all!&lt;/p&gt;

&lt;p&gt;A wanted to change &quot;belgium financial buttons&quot; with others in Company:&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=700374284893068016&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;To do this, my function (that works) in consultToolsCmd.js need to access Model('F_SIRET')&lt;/p&gt;

&lt;p&gt;So I customized MacroConsultCustom.txt like that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;//new buttons definition
ConsultCmdsTools.Comp      {[CmdMap;FindOnSocieteCom;FindOnInfogreffeFr;FindOnCorporamaCom]}

//buttons call send msg in my channel : financialFR
FindOnSocieteCom {[&amp;lt;%Macro(name=$macro$, $_more$=$more$, $class$=&quot;&quot;, $icon$=&quot;i-money&quot;, $caption$=&quot;voir sur societe.com&quot;, $msg$=&quot;financialFR;societe.com&quot;, $macro_sub_menu$=&quot;&quot;)%&amp;gt;]}
FindOnInfogreffeFr {[&amp;lt;%Macro(name=$macro$, $_more$=$more$, $class$=&quot;&quot;, $icon$=&quot;i-money&quot;, $caption$=&quot;voir sur infogreffe.fr&quot;, $msg$=&quot;financialFR;infogreffe.fr&quot;, $macro_sub_menu$=&quot;&quot;)%&amp;gt;]}
FindOnCorporamaCom {[&amp;lt;%Macro(name=$macro$, $_more$=$more$, $class$=&quot;&quot;, $icon$=&quot;i-money&quot;, $caption$=&quot;voir sur corporama.com&quot;, $msg$=&quot;financialFR;corporama.com&quot;, $macro_sub_menu$=&quot;&quot;)%&amp;gt;]}

//Add the field to the Model (my script need it)
JsonConsultModelCustom {[
        ,&quot;F_SIRET&quot;: &quot;&amp;lt;%GetField(F_SIRET,type=JSTEXT)%&amp;gt;&quot;
]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And finally i added a line in require.config.js&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;require.overrideModule('commands/consultToolsCmd');
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My buttons works an Exception is thrown in Product and Contact:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Message: DS&lt;em&gt;ProdConsult&lt;/em&gt;0&lt;em&gt;Prod: Field 'F&lt;/em&gt;SIRET' not found&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I don't understand why the Exception is thrown only in these entities (an Opportunity don't have F_SIRET)..&lt;/p&gt;

&lt;p&gt;Do I have to override JsonConsultModel.Comp instead of JsonConsultModelCustom ??&lt;/p&gt;

&lt;p&gt;Thanks a lot!&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2824/error-after-adding-custom-value-to-the-model</guid>
<pubDate>Mon, 11 Dec 2017 11:51:21 +0000</pubDate>
</item>
<item>
<title>How to add a ConsultCmdTool which is only visible for certain user groups?</title>
<link>https://overflow.efficy.io/?qa=2747/how-consultcmdtool-which-only-visible-certain-user-groups</link>
<description>&lt;p&gt;I want to make sure that only certain user groups can convert a opportunity into a project. How can I add a check on certain user groups in CmdConvertProj in MacroConsultCustom? &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ConsultCmdsTools.Oppo      {[CmdAddProducts;CmdCreateProposal;CmdFollowUp;CmdSuccess;CmdConvertProj;CmdSendBill]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thanks for your help!&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2747/how-consultcmdtool-which-only-visible-certain-user-groups</guid>
<pubDate>Mon, 20 Nov 2017 14:32:44 +0000</pubDate>
</item>
<item>
<title>Best way to create &quot;duplicate product button&quot; on product consult view</title>
<link>https://overflow.efficy.io/?qa=1994/best-create-duplicate-product-button-product-consult-view</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I want to do a &quot;duplicate product button&quot; on product consult screen (maybe on edit creen later)&lt;/p&gt;

&lt;p&gt;I want to know the best way to do it ?&lt;/p&gt;

&lt;p&gt;Thansk a lot&lt;/p&gt;

&lt;p&gt;regards&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1994/best-create-duplicate-product-button-product-consult-view</guid>
<pubDate>Thu, 03 Nov 2016 15:32:01 +0000</pubDate>
</item>
<item>
<title>Creation of an Entity in Efficy 2014</title>
<link>https://overflow.efficy.io/?qa=50/creation-of-an-entity-in-efficy-2014</link>
<description>&lt;p&gt;I created an entity in Conficy. The generated custom contains files such as xxxEdit.htm, xxxEditForm.htm... how should I integrate these in my custom, because I think these files follow the old 2012 structure?&lt;/p&gt;

&lt;p&gt;In the generated custom, there are also two files &quot;MacroConsultCustom.txt&quot; and &quot;MacroConsultNewCustom.txt&quot;. What is the difference, and which one should I use? Should I add both to my MacroConsultCustom.txt?&lt;/p&gt;
</description>
<category>Efficy Developers</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=50/creation-of-an-entity-in-efficy-2014</guid>
<pubDate>Tue, 14 Oct 2014 09:48:14 +0000</pubDate>
</item>
</channel>
</rss>