<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged associated-field</title>
<link>https://overflow.efficy.io/?qa=tag/associated-field</link>
<description>Powered by Question2Answer</description>
<item>
<title>Problem with Associated fields</title>
<link>https://overflow.efficy.io/?qa=4004/problem-with-associated-fields</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I followed the documentation to create 2 associated fields (&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.com/edn/admin/dsgn_createassociatedfields),&quot;&gt;https://help.efficy.com/edn/admin/dsgn_createassociatedfields),&lt;/a&gt; but when I go to my form, the associated field doesn't change value automatically.&lt;/p&gt;

&lt;p&gt;I did everything the doc said, the only thing missing is the definition of the fields we have to put in the designer, I tried LOOKUP and LOOKUPDROPDOWN, none of them work.&lt;/p&gt;

&lt;p&gt;Any help ?&lt;/p&gt;

&lt;p&gt;Efficy 11&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4004/problem-with-associated-fields</guid>
<pubDate>Tue, 05 Mar 2019 08:11:39 +0000</pubDate>
</item>
<item>
<title>ACTIONS : Custom field associated with Based field</title>
<link>https://overflow.efficy.io/?qa=3381/actions-custom-field-associated-with-based-field</link>
<description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;In Action entity I created a field &quot;F&lt;em&gt;SBTYPE&quot; (LK on LK&lt;/em&gt;ACTI_SUBTYPE)&lt;br&gt;
In the EditContext I want to define his selectables options according to the value of NATURE.&lt;/p&gt;

&lt;p&gt;Associated fields works in conficy only with 2 customs fields, but NATURE is not one.&lt;/p&gt;

&lt;p&gt;I try to to it and I have a problem :&lt;br&gt;
in Conficy ==&amp;gt; Action form (edit) I defined :&lt;br&gt;
- NATURE as LOOKUP&lt;br&gt;
- F_SUBTYPE as ACTISUBTYPE&lt;/p&gt;

&lt;p&gt;FormFieldsEditCustom.txt :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;label.ACTISUBTYPE.Acti {[Sous-type]}
field.ACTISUBTYPE.Acti {[
  &amp;lt;%RunQuery(id=&quot;ActiSubtype&quot;, sql=&quot;SELECT * FROM &amp;lt;#TABLE NAME=LK_ACTI_SUBTYPE&amp;gt;&quot;)%&amp;gt;
  &amp;lt;select name=&quot;F_SUBTYPE&quot; id=&quot;F_SUBTYPE&quot; title=&quot;&quot; data-placeholder=&quot;&amp;lt;%GetLabel('Select Value')%&amp;gt;...&quot; &amp;lt;%IfReadOnly(then='disabled')%&amp;gt;&amp;gt;
              &amp;lt;option value=&quot;-1&quot;&amp;gt;&amp;lt;/option&amp;gt;
              &amp;lt;%Delay(1)%&amp;gt;GetDataGrid(query=&quot;ActiSubtype&quot;, count=-1, TemplateText=|&amp;lt;#repeat&amp;gt;
                &amp;lt;option value='&amp;lt;#F=K_ACTI_SUBTYPE&amp;gt;' master='&amp;lt;#F=LK_ACTI_NATURE&amp;gt;' &amp;lt;#I=K_ACTI_SUBTYPE;&amp;lt;%GetField('NATURE')%&amp;gt;=selected='selected';#ELSE=&amp;gt;&amp;gt;&amp;lt;#F=F_SUBTYPE&amp;gt;&amp;lt;/option&amp;gt;
              &amp;lt;/#repeat&amp;gt;|
  )%&amp;gt;
  &amp;lt;/select&amp;gt;
]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;MacroEditSCustom.txt :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function AfterLoaded() {
        // ...
        fctLinkMarsterDetail(&quot;NATURE&quot;, &quot;F_SUBTYPE&quot;);
}

function fctLinkMarsterDetail(p_Master, p_Detail) {
      var $master = $(&quot;#&quot;+p_Master);
      if ($master.length &amp;gt; 0) {
        $master.change(function() {
          fctUpdateDetail(p_Master, p_Detail, true);
        });
        fctUpdateDetail(p_Master, p_Detail, false);
      }
    }

    function fctUpdateDetail(pMaster, pDetail, pChange) {
      var $master = $(&quot;#&quot;+pMaster);
      var $detail = $(&quot;#&quot;+pDetail);
      var master = $master.val();

      if( master == &quot;&quot; || master == &quot;0&quot; ){
        $detail.select2('readonly', true).select2(&quot;val&quot;, &quot;0&quot;);
      }
      else {
        if(pChange){
          $detail.select2(&quot;val&quot;, &quot;0&quot;);
        }
        $detail.select2('readonly', false);                                           
        if ($detail.length &amp;gt; 0){
          $('#'+pDetail + ' &amp;gt; option').each(function() {
            if($(this).attr('master') != 0 &amp;amp;&amp;amp; $(this).attr('master') != master) {
              $(this).attr('class','show-for-portrait');
            }
            else {
              $(this).attr('class','');
            }
          });
        }
      }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My problem is that the field in Edit form looks like a number input:&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=2423341843785499854&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
Can anyone say me why Efficy ignore my Definition ?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3381/actions-custom-field-associated-with-based-field</guid>
<pubDate>Thu, 05 Jul 2018 14:33:18 +0000</pubDate>
</item>
</channel>
</rss>