<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged cont_comp</title>
<link>https://overflow.efficy.io/?qa=tag/cont_comp</link>
<description>Powered by Question2Answer</description>
<item>
<title>avoid relation cont-comp modification</title>
<link>https://overflow.efficy.io/?qa=3386/avoid-relation-cont-comp-modification</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I try to avoid the modification of a main relation using workflow and I get troubles:&lt;br&gt;
  With the code below when I try to modify or delete relation by edit relation on contact THIS WORK&lt;br&gt;
but when I edit contact and change/delete on the right side the company link nothing is trigger and the link is change ???&lt;/p&gt;

&lt;p&gt;How can I avoid the fact that the relation can be change on edit contact ?&lt;/p&gt;

&lt;p&gt;Best regards.&lt;/p&gt;

&lt;p&gt;here is my code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function BeforeCommitContComp(EditHandle, Inserted) {
    log(&quot;beforeCommitContComp&quot;);
    var 
        ContCompDataSet = EfficyAPI.GetMasterDataSet(EditHandle, 0),
        ContKey = ContCompDataSet.FieldByName('K_CONTACT').AsFloat,
        ContMain = ContCompDataSet.FieldByName('MAIN').AsString;
    if(IsMainComp(ContKey) &amp;amp;&amp;amp; ContMain == '0') {
        log(&quot;Vous ne pouvez pas changer la relation entre ce contact et une société mère ! k-contact=&quot; + ContKey);
        throw new Error(&quot;You can't change relation between this contact and main company!&quot;);
    }
}

function OnBeforeDeleteContComp(Key, DetailKey) {
    log(&quot;OnBeforeDeleteContComp&quot;);
    if(IsMainComp(Key)) {
        log(&quot;Vous ne pouvez pas effacer le lien avec une société mère ! k_contact=&quot; + Key);
        throw new Error(&quot;You can't delete relation with a main company!&quot;);
    }
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Efficy Partners</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3386/avoid-relation-cont-comp-modification</guid>
<pubDate>Tue, 10 Jul 2018 12:32:19 +0000</pubDate>
</item>
<item>
<title>Error on editing cont_comp relation</title>
<link>https://overflow.efficy.io/?qa=3365/error-on-editing-contcomp-relation</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;We got a strange problem on the crm when editing a cont_comp relation with a custom fields added. When on a contact consult screen tab company if we try to modify relation everything is okay. But for the same contact in edit form screen when we want to modify the company relation an error occur (see screenshot). We try with no custom and we got the same error, so we know that came from database but we don't know where to fixe it.&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=14565227782382637604&quot; alt=&quot;error editing relation&quot;&gt;&lt;/p&gt;
</description>
<category>Efficy Partners</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3365/error-on-editing-contcomp-relation</guid>
<pubDate>Tue, 03 Jul 2018 15:59:11 +0000</pubDate>
</item>
</channel>
</rss>