<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions in How to</title>
<link>https://overflow.efficy.io/?qa=questions/category-users/how-to</link>
<description>Powered by Question2Answer</description>
<item>
<title>SMS récurrent / recurring sms</title>
<link>https://overflow.efficy.io/?qa=7052/sms-recurrent-recurring-sms</link>
<description>&lt;p&gt;Bonjour,&lt;br&gt;
Je souhaite paramétrer l'envoi d'une campagne SMS récurrente sur la Version 2021.&lt;br&gt;
Je comprends que dans NetBusiness, l'écran de création d'un SMS récurrent fonctionne comme l'envoi d'emailing récurrent mais comment est déclenché l'envoi ?&lt;br&gt;
Pour les emails il y a une tâche planifiée mais pas pour les sms.&lt;br&gt;
Je ne vois rien dans l'aide en ligne, seuls les emailings récurrents sont présentés mais pas les sms. Pourtant la fonctionnalité &quot;type = envoi récurrent&quot; est bien proposé dans Edeal pour les sms. C'est très confusant pour les utilisateurs.&lt;br&gt;
Merci&lt;/p&gt;

&lt;p&gt;Hello,&lt;br&gt;
I would like to configure the sending of a recurring SMS campaign on Version 2021.&lt;br&gt;
I understand that in NetBusiness, the screen for creating a recurring SMS works like sending a recurring email, but how is the sending triggered?&lt;br&gt;
For emails there is a scheduled task but not for SMS.&lt;br&gt;
I don't see anything in the online help, only recurring emails are presented but not text messages. However, the “type = recurring sending” functionality is indeed offered in Edeal for SMS. This is very confusing for users.&lt;br&gt;
Thanks&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7052/sms-recurrent-recurring-sms</guid>
<pubDate>Thu, 21 Mar 2024 09:19:17 +0000</pubDate>
</item>
<item>
<title>How can I insert (picture or signature) into a Word template by using runscripts into a contact array</title>
<link>https://overflow.efficy.io/?qa=6947/insert-picture-signature-template-runscripts-contact-array</link>
<description>&lt;p&gt;Hello I have to generate a template with a list of contacts.&lt;br&gt;
Here it's simple, but for each line I have to insert a signature field.&lt;/p&gt;

&lt;p&gt;I have to detect if contact has signed on the morning then on the afternoon or maybe only one of these conditions.&lt;/p&gt;

&lt;p&gt;So we decided to use runscripts. In that case it's working if I display only the name and firstname, but the goal is to be able to display his signature to. &lt;/p&gt;

&lt;p&gt;And here we haven't be able to run the template without errors.&lt;br&gt;
What kind of trick can we use to generate a such document ? &lt;/p&gt;

&lt;p&gt;I also tried to use some arguments like for type memo for instance. &lt;br&gt;
But the document is corrupted. When I keep the syntax &amp;lt;#F=PICTURE&amp;gt; or &amp;lt;#F=F_SIGNATURE&amp;gt; it merge with only this indication : (blob)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=13609799535560111993&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
Thank's Laurent&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6947/insert-picture-signature-template-runscripts-contact-array</guid>
<pubDate>Mon, 07 Aug 2023 14:46:34 +0000</pubDate>
</item>
<item>
<title>Extranet  invoicing</title>
<link>https://overflow.efficy.io/?qa=6810/extranet-invoicing</link>
<description>&lt;p&gt;Hello to all, &lt;br&gt;
I have a question, is it possible for the customer to have the invoices and their status (paid/not paid, ...) on his extranet?&lt;br&gt;
Because I have heard that this option exists but I have not found any trace.&lt;/p&gt;

&lt;p&gt;Thanks to all&lt;br&gt;
Mohamed Support Team &lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6810/extranet-invoicing</guid>
<pubDate>Tue, 14 Feb 2023 08:25:43 +0000</pubDate>
</item>
<item>
<title>how install wsl linux extension to Install Elastic Search for Efficy on a 2019 server</title>
<link>https://overflow.efficy.io/?qa=6775/install-linux-extension-install-elastic-search-efficy-server</link>
<description>&lt;p&gt;Hello&lt;br&gt;
I want to configure the Elastic Search functionality Into my on premise serveur 2019.&lt;br&gt;
I found this tutorial but it's only for windows 10 not for server version.&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/install-es-wsl&quot;&gt;https://help.efficy.io/edn/projectguides/install-es-wsl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I guess you have done it on your own servers for cloud customers. So I think you have a step by step tutorial to install the linux feature.&lt;/p&gt;

&lt;p&gt;Thank's &lt;br&gt;
Laurent Tuffraud&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6775/install-linux-extension-install-elastic-search-efficy-server</guid>
<pubDate>Tue, 06 Dec 2022 17:03:33 +0000</pubDate>
</item>
<item>
<title>how open a soap session by using api token rather than efficy:logon xml tag ?</title>
<link>https://overflow.efficy.io/?qa=6765/how-open-soap-session-using-api-token-rather-than-efficy-logon</link>
<description>&lt;p&gt;Hello I want to use the advantages of the API token authentification into à soap request rather than using the old body xml tag for a migration from 11.0 to 12.0 version.&lt;/p&gt;

&lt;p&gt;&lt;br&gt;
So I generated a token into my designer, then I added into the header the &lt;br&gt;
X-Efficy-ApiKey, X-Efficy-Customer and X-Efficy-Logoff = true like I already done for node connexion for instance.&lt;/p&gt;

&lt;p&gt;The customer profile is unique into my url so didn't declare it.&lt;/p&gt;

&lt;p&gt;Bug I'm not able to create the connexion to execute a soap query resquest. &lt;br&gt;
&lt;br&gt;
So I have to continue to put all information &lt;br&gt;
Any idea ?&lt;br&gt;
What I missed ? &lt;/p&gt;

&lt;p&gt;have you any postman exemple with a body using datacontainer operation=&quot;query&quot; + connexion via token ?&lt;/p&gt;

&lt;p&gt;Thank's &lt;br&gt;
Laurent Tuffraud&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6765/how-open-soap-session-using-api-token-rather-than-efficy-logon</guid>
<pubDate>Thu, 24 Nov 2022 08:13:25 +0000</pubDate>
</item>
<item>
<title>Is there a way to resynchronize into Efficy a campaign which has launched directly from Flexmail?</title>
<link>https://overflow.efficy.io/?qa=6367/resynchronize-efficy-campaign-launched-directly-flexmail</link>
<description>&lt;p&gt;A campaign has been launched from Flexmail by error. Is there any possibility to get this campaign resynchronized back into Efficy, so that we can also get the campaign report available in Efficy?&lt;br&gt;
Which procedure do we need to follow to do that?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6367/resynchronize-efficy-campaign-launched-directly-flexmail</guid>
<pubDate>Thu, 25 Nov 2021 12:45:37 +0000</pubDate>
</item>
<item>
<title>how to fill the data into the LK with EditInitialized into the workflow for the mobile Application ?</title>
<link>https://overflow.efficy.io/?qa=6363/into-with-editinitialized-into-workflow-mobile-application</link>
<description>&lt;p&gt;I created into my function EditInitializedComp an instruction to update some LK fields depending on user preferences. &lt;br&gt;
Into the web version it's working perfectly.&lt;br&gt;
But when I create a new company from mobile App it seem that the EditInitializedComp is not used.&lt;/p&gt;

&lt;p&gt;Any solution to do the same thing by loading the workflow. &lt;br&gt;
Thank's &lt;br&gt;
Laurent&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6363/into-with-editinitialized-into-workflow-mobile-application</guid>
<pubDate>Tue, 23 Nov 2021 16:57:31 +0000</pubDate>
</item>
<item>
<title>How customize relations fields to show + icon on mobile APP</title>
<link>https://overflow.efficy.io/?qa=6343/how-customize-relations-fields-to-show-icon-on-mobile-app</link>
<description>&lt;p&gt;I want to display 3 informations in relation of a custom entity like for exemple the actions where it possible to display the subject, d_begin and mode.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;Acti&quot;: {
                 &quot;default&quot;: [{
                         &quot;field&quot;: &quot;SUBJECT&quot;,
                         &quot;spaces&quot;: 13
                 }, {
                         &quot;field&quot;: &quot;D_BEGIN&quot;,
                         &quot;display&quot;: &quot;date&quot;
                 }, {
                         &quot;field&quot;: &quot;MODE&quot;
                 }],
                 &quot;favorite&quot;: [{
                         &quot;field&quot;: &quot;NAME&quot;,
                         &quot;template&quot;: &quot;#NAME#&quot;
                 }]
         },
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=8112706156549623302&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;So I customized as for Acti my new entity like that : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;{
   &quot;entities&quot;:{
      &quot;Amou&quot;:{
         &quot;active&quot;:false,
         &quot;icon&quot;:&quot;Amou&quot;
      }
   },
   &quot;listCardDefinitions&quot;:{
      &quot;Amou&quot;:{
         &quot;default&quot;:[
            {
               &quot;field&quot;:&quot;NAME&quot;,
               &quot;spaces&quot;:13
            },
            {
               &quot;field&quot;:&quot;F_D_START&quot;,
               &quot;display&quot;:&quot;date&quot;
            },
            {
               &quot;field&quot;:&quot;R_F_KIND&quot;
            },
            {
               &quot;field&quot;:&quot;F_OBJECTIVE&quot;
            }
         ]
      }
   },
   &quot;entityRelations&quot;:{
      &quot;Amou&quot;:&quot;User,Cont,Comp&quot;
   }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But I only have the Name field &quot;test pour integration mobile&quot; not the 3 fields I want to display.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=6107995832337564721&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;Second problem is the icon.  How display the custom icon ? &lt;br&gt;
in The web version it's an euro&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=11225265996769085107&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;So I try to display it by using like for the other entities the name of the custom amou. I try all amou, amous, amounts. It display each time an &quot;?&quot;.&lt;br&gt;
I try also to use the i-euro but without success. &lt;/p&gt;

&lt;p&gt;Any one can help me to display fields and icons has I want ?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6343/how-customize-relations-fields-to-show-icon-on-mobile-app</guid>
<pubDate>Wed, 03 Nov 2021 16:02:59 +0000</pubDate>
</item>
<item>
<title>Unable to see page without Full Access Rights</title>
<link>https://overflow.efficy.io/?qa=6240/unable-to-see-page-without-full-access-rights</link>
<description>&lt;p&gt;Hello all,&lt;/p&gt;

&lt;p&gt;I have an issue with 12.0 where I cannot see some pages without the &quot;Full Access (no security - NOT RECOMMENDED)&quot; enabled.&lt;/p&gt;

&lt;p&gt;But I still have the search available (see screenshot) :&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=14967766481339916343&quot; alt=&quot;dashboard&quot;&gt;&lt;/p&gt;

&lt;p&gt;As for rights :&lt;br&gt;
- One group : Administrator&lt;br&gt;
- Privileges : Administer Dashboards&lt;br&gt;
- Table rights : everything for Dashboard, Widgets, ....&lt;/p&gt;

&lt;p&gt;I have the same issue on 2 different 12.0 solutions, with the same settings.&lt;/p&gt;

&lt;p&gt;Only way to access it is through the direct URL (solutionurl/crm/entitylist?entity=Dash&amp;amp;page=desktop/List&amp;amp;gridname=DashList&amp;amp;active=true&amp;amp;opened=true&amp;amp;recentlyused=true&amp;amp;rse=T) which is accessible because of table rights on my user.&lt;/p&gt;

&lt;p&gt;Also, there is this related unanswered question where Support may have found a way :&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://overflow.efficy.io/?qa=5494/security-dashboard&amp;amp;show=5494#q5494&quot;&gt;https://overflow.efficy.io/?qa=5494/security-dashboard&amp;amp;show=5494#q5494&lt;/a&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6240/unable-to-see-page-without-full-access-rights</guid>
<pubDate>Fri, 30 Jul 2021 08:11:50 +0000</pubDate>
</item>
<item>
<title>My ranking and Global ranking: How is it calculated?</title>
<link>https://overflow.efficy.io/?qa=6231/my-ranking-and-global-ranking-how-is-it-calculated</link>
<description>&lt;p&gt;Can somebody tell me how the fields 'My Ranking' and 'Global ranking' are exactly calculated?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6231/my-ranking-and-global-ranking-how-is-it-calculated</guid>
<pubDate>Mon, 19 Jul 2021 14:29:44 +0000</pubDate>
</item>
<item>
<title>Extranet - Notification per email for the customers ?</title>
<link>https://overflow.efficy.io/?qa=6214/extranet-notification-per-email-for-the-customers</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Some of my customers do not receive an email when a new information is added to an incident on the Extranet.&lt;/p&gt;

&lt;p&gt;How can they control the notifications per email from the extranet?&lt;/p&gt;

&lt;p&gt;Thanks for your answer,&lt;/p&gt;

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

&lt;p&gt;Aurélie&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6214/extranet-notification-per-email-for-the-customers</guid>
<pubDate>Tue, 06 Jul 2021 12:23:29 +0000</pubDate>
</item>
<item>
<title>How does work Efficy.impersonateUser(impersonateAccount, forceUserRole)</title>
<link>https://overflow.efficy.io/?qa=6160/efficy-impersonateuser-impersonateaccount-forceuserrole</link>
<description>&lt;p&gt;how is working this new option for remote in Efficy 12 &lt;strong&gt;Efficy.impersonateUser(impersonateAccount, forceUserRole)&lt;/strong&gt;&lt;br&gt;
Is it same as &lt;strong&gt;Efficy.forceUserRole(roleId)&lt;/strong&gt; but not for remote ?&lt;/p&gt;

&lt;p&gt;It's stricly only available on remote or can we use it with an Efficy scheduler ?&lt;br&gt;
My goal is to be able to change user as owner when creating a record form script. &lt;br&gt;
Does it really take the role and all securities rules on creation ? &lt;/p&gt;

&lt;p&gt;I mean that if you check the impersonate option for user in designer you can use it as an impersonate. That is the right way to use it ? &lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6160/efficy-impersonateuser-impersonateaccount-forceuserrole</guid>
<pubDate>Thu, 10 Jun 2021 13:31:38 +0000</pubDate>
</item>
<item>
<title>COntacts synced to Flexmail depends on language</title>
<link>https://overflow.efficy.io/?qa=5905/contacts-synced-to-flexmail-depends-on-language</link>
<description>&lt;p&gt;FYI:&lt;/p&gt;

&lt;p&gt;-It seems that the sync of contact between Efficy and Flexmail depends on a setting @Flexmail side&lt;br&gt;
-If the language is not added by Flexmail, then those contacts will not be synced…&lt;/p&gt;

&lt;p&gt;So if you run into issues where some contacts are not synced… check the language of the contact and then ask Flexmail support to add that language for the sync (API).&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5905/contacts-synced-to-flexmail-depends-on-language</guid>
<pubDate>Tue, 16 Feb 2021 15:16:15 +0000</pubDate>
</item>
<item>
<title>&quot;New Outlook&quot; and Efficy macOs Sidebar compatibility issue</title>
<link>https://overflow.efficy.io/?qa=5838/new-outlook-and-efficy-macos-sidebar-compatibility-issue</link>
<description>&lt;p&gt;The new version of Outlook for macOs features a new interface (not activated by default)&lt;/p&gt;

&lt;p&gt;Users can activate this new interface from the main Outlook window:&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=12768790348899668153&quot; alt=&quot;activated new interface&quot;&gt;&lt;/p&gt;

&lt;p&gt;Once this &quot;New Outlook&quot; is activated, the Efficy Sidebar will no longer be able to communicate with Outlook and the Sidebar buttons will do nothing.&lt;/p&gt;

&lt;p&gt;Microsoft has not (yet) enabled Applescript in the new interface. If you are affected by this issue, don't hesitate to Upvote the following suggestion&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://outlook.uservoice.com/forums/924856-the-new-outlook-for-mac/suggestions/39253423-support-applescript&quot;&gt;https://outlook.uservoice.com/forums/924856-the-new-outlook-for-mac/suggestions/39253423-support-applescript&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Meanwhile, you can go back to the old interface simply by unchecking &quot;New Outlook&quot; on the top right of the main Outlook window.&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=8116885636237460122&quot; alt=&quot;old interface&quot;&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5838/new-outlook-and-efficy-macos-sidebar-compatibility-issue</guid>
<pubDate>Fri, 29 Jan 2021 07:00:32 +0000</pubDate>
</item>
<item>
<title>Where can I find the standard agenda colors for different languages in Efficy 11.3</title>
<link>https://overflow.efficy.io/?qa=5788/where-find-standard-agenda-colors-different-languages-efficy</link>
<description>&lt;p&gt;Before customizing the agenda colors for a customer, the customer wants to know the Action modes / corresponding agenda colors which are by default available in Efficy.&lt;/p&gt;

&lt;p&gt;I have tried to find them anywhere, but failed.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5788/where-find-standard-agenda-colors-different-languages-efficy</guid>
<pubDate>Thu, 07 Jan 2021 07:50:32 +0000</pubDate>
</item>
<item>
<title>Selection view - native SQL - call query from SQL</title>
<link>https://overflow.efficy.io/?qa=5702/selection-view-native-sql-call-query-from-sql</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;On a Efficy cloud server version, is it possible to call the result of an existing query from a new query in native mode.&lt;/p&gt;

&lt;p&gt;simplified example&lt;br&gt;
query_1 : select company.name, company.key from companies&lt;/p&gt;

&lt;p&gt;new query :&lt;br&gt;
select company.name, sum(table&lt;em&gt;X.sales&lt;/em&gt;Y1) &lt;br&gt;
from query&lt;em&gt;1 join on &lt;br&gt;
company.key= table&lt;/em&gt;X.company_key&lt;br&gt;
group by company.name&lt;/p&gt;

&lt;p&gt;I could combine both SQL in one but both SQL have long strings...and I would prefer to seperate each SQL in different &quot;containers&quot;, as the query_1 output is to be used with other query results (not only sales)&lt;/p&gt;

&lt;p&gt;Thanks&lt;br&gt;
pat&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5702/selection-view-native-sql-call-query-from-sql</guid>
<pubDate>Tue, 01 Dec 2020 11:12:33 +0000</pubDate>
</item>
<item>
<title>Efficy Drive - Is there a alternative solution for Mac?</title>
<link>https://overflow.efficy.io/?qa=5681/efficy-drive-is-there-a-alternative-solution-for-mac</link>
<description>&lt;p&gt;Seen that Efficy Drive doesn't support MacOS,&lt;br&gt;
is there an alternative solution we can propose customers ?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Something with Google Drive ?&lt;/li&gt;
&lt;li&gt;Is Efficy Drive for Mac in the pipeline ?&lt;/li&gt;
&lt;li&gt;other ideas&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I need to know what I can tell my customer.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5681/efficy-drive-is-there-a-alternative-solution-for-mac</guid>
<pubDate>Tue, 10 Nov 2020 12:37:08 +0000</pubDate>
</item>
<item>
<title>How to add Documents, tasks, products, opportunities, cases, mails to a Step like if it was into Stage.</title>
<link>https://overflow.efficy.io/?qa=5660/documents-tasks-products-opportunities-cases-mails-stage</link>
<description>&lt;p&gt;I need to link documents, tasks, products, opportunities, cases, mails to a Step like if it was into a Stage.&lt;br&gt;
I added a new tab products on stages and it work sot the method to attach tables is ok, but no one of the tab is working when I call a step. I saw that some of WkldEditDetailTabHeaders and WkldEditDetailTabContents was filter by &amp;lt;# if (!isStep) { #&amp;gt; or &amp;lt;# if (isStep) { #&amp;gt;&lt;/p&gt;

&lt;p&gt;So in my custom I changed some stuff to make it appear and I created a variant of the addLink button to have &lt;br&gt;
&lt;strong&gt;data-msg=&quot;addLink;WrkStep;&amp;lt;#=@ data.key #&amp;gt;;$detail$&quot;&lt;/strong&gt; or &lt;strong&gt;data-msg=&quot;addLink;WrkStag;&amp;lt;#=@ data.key #&amp;gt;;$detail$&quot;&lt;/strong&gt; both (WrkStep and WrkStag) are existing into the sys_tableviews. &lt;br&gt;
Why it has no effect on addLink for steps while it work's on step. I call only a basic addLink.&lt;/p&gt;

&lt;p&gt;Into MacroWorkloadCustom I changed the standard like this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For main entity commnands :&lt;/strong&gt; &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;WkldEditDetailTabHeaders {[WkldTabHeaderFields;WkldTabHeaderMemo;WkldTabHeaderActi;WkldTabHeaderCase;WkldTabHeaderDocu;WkldTabHeaderMail;WkldTabHeaderOppo;WkldTabHeaderProd]}
WkldEditDetailTabContents {[WkldTabContentFields;WkldTabContentMemo;WkldTabContentActi;WkldTabContentCase;WkldTabContentDocu;WkldTabContentMail;WkldTabContentOppo;WkldTabContentProd]}
WkldDetailGridColumns..Prod {[MENU2,NAME]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;For workload MicroTemplate :&lt;/strong&gt; &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;WkldTabHeaderActi   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-acti&quot; class=&quot;i-Acti&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}
WkldTabHeaderCase   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-case&quot; class=&quot;i-Case&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}
WkldTabHeaderDocu   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-docu&quot; class=&quot;i-Docu&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}
WkldTabHeaderMail   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-mail&quot; class=&quot;i-Mail&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}
WkldTabHeaderOppo   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-oppo&quot; class=&quot;i-Oppo&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}
WkldTabHeaderProd   {[&amp;lt;dd&amp;gt;&amp;lt;a href=&quot;#tab-prod&quot; class=&quot;i-Prod&quot; draggable=&quot;false&quot;&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/dd&amp;gt;]}

WkldTabContentActi {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-acti&quot; data-entity=&quot;Acti&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Acti', $addlabel$='Add Link to Action')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-acti&quot; data-entity=&quot;Acti&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Acti', $addlabel$='Add Link to Action')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentCase {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-case&quot; data-entity=&quot;Case&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Case', $addlabel$='Add Link to Incident')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-case&quot; data-entity=&quot;Case&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Case', $addlabel$='Add Link to Incident')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentDocu {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-docu&quot; data-entity=&quot;Docu&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Docu', $addlabel$='Add Link to Document')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-docu&quot; data-entity=&quot;Docu&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Docu', $addlabel$='Add Link to Document')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentMail {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-mail&quot; data-entity=&quot;Mail&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Mail', $addlabel$='Add Link to Mail')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-mail&quot; data-entity=&quot;Mail&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Mail', $addlabel$='Add Link to Mail')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentOppo {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-oppo&quot; data-entity=&quot;Oppo&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Oppo', $addlabel$='Add Link to Opportunity')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-oppo&quot; data-entity=&quot;Oppo&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Oppo', $addlabel$='Add Link to Opportunity')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentProd {[
&amp;lt;# if (!isStep) { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-prod&quot; data-entity=&quot;Prod&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetail', detail='Prod', $addlabel$='Add Link to Product')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } else { #&amp;gt;
&amp;lt;div class=&quot;content tabs-content-item&quot; id=&quot;tab-prod&quot; data-entity=&quot;Prod&quot;&amp;gt;
&amp;lt;%Macro('WkldTabContentDetailStep', detail='Prod', $addlabel$='Add Link to Product')%&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;# } #&amp;gt;
]}

WkldTabContentDetailStep {[
&amp;lt;div class=&quot;row&quot;&amp;gt;
&amp;lt;div class=&quot;small-2 medium-1 columns&quot;&amp;gt;
&amp;lt;button type=&quot;button&quot; class=&quot;icon i-add&quot; title=&quot;&amp;lt;%GetLabel('$addlabel$', context=ATTR)%&amp;gt;&quot; data-msg=&quot;addLink;WrkStep;&amp;lt;#=@ data.key #&amp;gt;;$detail$&quot;&amp;gt;&amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;small-12 medium-11 columns&quot;&amp;gt;
&amp;lt;h3 class=&quot;section-title&quot;&amp;gt;&amp;lt;%GetLabel('$detail$s', context=TEXT)%&amp;gt;&amp;lt;/h3&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;row&quot;&amp;gt;
&amp;lt;div class=&quot;small-12 columns wkld-detail-grid&quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So I remove the if clause into the header and contents to remove the restriction on steps. And I added a macro called depending on if it's step or not. If yes the addling is done on WrkStep or if not on WrkStag.&lt;br&gt;
I have missed something to finish the job.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5660/documents-tasks-products-opportunities-cases-mails-stage</guid>
<pubDate>Fri, 23 Oct 2020 09:32:36 +0000</pubDate>
</item>
<item>
<title>How To Sync Googla Agenda with Efficy ?</title>
<link>https://overflow.efficy.io/?qa=5651/how-to-sync-googla-agenda-with-efficy</link>
<description>&lt;p&gt;Hello, how to sync Gmail Agenda with the marketplace addin ?&lt;br&gt;
The addin work good but i want to sync the agenda too, someone have a documentation for this ?&lt;br&gt;
Thanks a lot.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5651/how-to-sync-googla-agenda-with-efficy</guid>
<pubDate>Thu, 15 Oct 2020 15:18:32 +0000</pubDate>
</item>
<item>
<title>How to set customer parameter in SOAP request?</title>
<link>https://overflow.efficy.io/?qa=5603/how-to-set-customer-parameter-in-soap-request</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;our database was cloned and since then, we need to pass the customer parameter.&lt;br&gt;
When i try to connect via SOAP, i get 'The host is allowed in more than one customer profile, the &quot;customer&quot; argument must be specified'. &lt;br&gt;
If i try to pass the customer attribute in the efficy:logon node, where username, database and password is passed, i still get the same error.&lt;/p&gt;

&lt;p&gt;Where do i have to set this parameter?&lt;/p&gt;

&lt;p&gt;Best&lt;br&gt;
Stefan&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5603/how-to-set-customer-parameter-in-soap-request</guid>
<pubDate>Mon, 28 Sep 2020 07:31:08 +0000</pubDate>
</item>
<item>
<title>How to upgrade sidebar after migration (Efficy 11)</title>
<link>https://overflow.efficy.io/?qa=5554/how-to-upgrade-sidebar-after-migration-efficy-11</link>
<description>&lt;ol&gt;
&lt;li&gt;Log manually in your Efficy ( example.efficy.com)&lt;/li&gt;
&lt;li&gt;Enter your login and access to your home page of Efficy&lt;/li&gt;
&lt;li&gt;go to the right top and select &quot; Sidebar and Add Ins &quot;&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=15745653818928017966&quot; alt=&quot;enter image description here&quot;&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download your new Sidebar and run it.&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=1932074900571729184&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The installation software gonna remove the old version and install the new one. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the installation you can run the app  from your desktop.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In case of error check if your profile is selected, right click on you sidebar &amp;gt; Profile&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;in case of that you don't have a profile. &amp;gt; Open again the windows &quot; Sidebar and Addins&quot; and select the option &amp;gt; Configure the Efficy Sidebar&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A little windows gonna open and ask for your EFFICY PASSWORD &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;The profile name is not your username (so you can give any name that you want.) Efficy detect automatically your username.&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5554/how-to-upgrade-sidebar-after-migration-efficy-11</guid>
<pubDate>Fri, 28 Aug 2020 08:24:34 +0000</pubDate>
</item>
<item>
<title>Cannot save document via Mac (file size not showing)- MacOs Catalina</title>
<link>https://overflow.efficy.io/?qa=5548/cannot-save-document-via-mac-file-size-showing-macos-catalina</link>
<description>&lt;p&gt;after the last update (August 2020) several user have an issue with converting emails to documents.&lt;/p&gt;

&lt;p&gt;The issue is that the name of the file are present but not the file size like this example:&lt;br&gt;
&lt;img src=&quot;http://&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5548/cannot-save-document-via-mac-file-size-showing-macos-catalina</guid>
<pubDate>Wed, 19 Aug 2020 07:19:32 +0000</pubDate>
</item>
<item>
<title>Email Template using multiple tables</title>
<link>https://overflow.efficy.io/?qa=5374/email-template-using-multiple-tables</link>
<description>&lt;p&gt;Hi all,&lt;br&gt;
I am facing some difficulties to implement a new email template. &lt;br&gt;
In our using context, we have to send an email to a specific contact of a company. &lt;br&gt;
In this email, we include some information about a case in helpdesk like the company which is impacted.&lt;br&gt;
We are using multiple link between an incident and companies. And each company has a specific type (&quot;Adhérent&quot;, &quot;Fournisseur&quot;) &lt;br&gt;
So my question is, I would be able to insert in my template the Company name where the relation between the company and case has the value &quot;1&quot; (Adhérent)&lt;br&gt;
I tried to do this with the operator &quot;onfield&quot; but I cannot obtain  the value of the filed just text. &lt;br&gt;
Can you help me for this ? &lt;br&gt;
Regards,,&lt;br&gt;
Take care.&lt;br&gt;
Julien&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5374/email-template-using-multiple-tables</guid>
<pubDate>Tue, 31 Mar 2020 09:36:03 +0000</pubDate>
</item>
<item>
<title>Steps of a timesheet</title>
<link>https://overflow.efficy.io/?qa=5323/steps-of-a-timesheet</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
How can I fill the list of steps avalable while creating a timesheet record ?&lt;br&gt;
Thank you&lt;br&gt;
Dimiri&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5323/steps-of-a-timesheet</guid>
<pubDate>Tue, 25 Feb 2020 13:10:15 +0000</pubDate>
</item>
<item>
<title>Timesheet record deletion</title>
<link>https://overflow.efficy.io/?qa=5322/timesheet-record-deletion</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
How is it possible to delete a timesheet record ?&lt;br&gt;
Thank you&lt;br&gt;
Dimitri&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5322/timesheet-record-deletion</guid>
<pubDate>Tue, 25 Feb 2020 13:08:00 +0000</pubDate>
</item>
<item>
<title>How to use a group as K_ACCOUNT into a dashboard 11.3 version</title>
<link>https://overflow.efficy.io/?qa=5290/how-to-use-a-group-as-kaccount-into-a-dashboard-11-3-version</link>
<description>&lt;p&gt;It's seem that it's impossible to attach a group into the key accounts of dashboards.&lt;br&gt;
When I attach a user the dashboard is well displayed but not with a group of users.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=15513330644267771896&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;As explain into the documentation only groups as role are available: &lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.com/edn/admin/crft_11_kpi_dash_levels&quot;&gt;&lt;/a&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.com/edn/admin/crft_11_kpi_dash_levels&quot;&gt;https://help.efficy.com/edn/admin/crft_11_kpi_dash_levels&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Ownership levels The &quot;owner&quot; of the dashboard represents the level of&lt;br&gt;
  ownership which can have one of those three values:&lt;/p&gt;
  
  &lt;p&gt;Company or Global level This is the highest level. Setting a dashboard&lt;br&gt;
  at this level will cause every Efficy user to see its content.&lt;/p&gt;
  
  &lt;p&gt;Role or Group level When a dashboard defines a user group as owner,&lt;br&gt;
  all users having this group as main Role will see the contents in a&lt;br&gt;
  combined dashboard.&lt;/p&gt;
  
  &lt;p&gt;User level When a dashboard has user as owner, only this user will see&lt;br&gt;
  the widgets in this dashboard.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But if you use a group not like a role it's impossible. Is there a solution to do it just by groups ?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5290/how-to-use-a-group-as-kaccount-into-a-dashboard-11-3-version</guid>
<pubDate>Wed, 05 Feb 2020 10:57:46 +0000</pubDate>
</item>
<item>
<title>What is the key value for SYNCHRO_RELATION_CONTACT in constant.js for flexmail.</title>
<link>https://overflow.efficy.io/?qa=5262/what-the-value-synchrorelationcontact-constant-flexmail</link>
<description>&lt;p&gt;I have to change the way to synchronize flexmail to a new entity. I manipulated the constant.js file into the serverJs and I want to understand  what are the variable values.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; var SYNCHRO_RELATION_CONTACT = 2,
SYNCHRO_RELATION_PREFERENCE = 24,
TABLEID_CONTACTS = 11000,
TABLEID_PROFILES = 24000,
LK_PROF_FLEXKIND_PREFERENCE = '2',
SYNC_D_CHANGE_ERROR = 10 / 86400,
APPID_SYNCSERVER = 27,
TIMEZONE_UTC = 100,
TIMEZONE_ROMANCE = 172, //172 = GMT+1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I don't know what are :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SYNCHRO&lt;em&gt;RELATION&lt;/em&gt;CONTACT. (Maybe the USERKEY of ADMIN ?)&lt;/li&gt;
&lt;li&gt;SYNCHRO&lt;em&gt;RELATION&lt;/em&gt;PREFERENCE (24 seem to be relative to the profile table number ?)&lt;/li&gt;
&lt;li&gt;APPID_SYNCSERVER ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The other variable are clear.&lt;/p&gt;

&lt;p&gt;so can I do something like that and if 2 is the key of administrator user maybe having a customized SYNCHRO&lt;em&gt;RELATION&lt;/em&gt;FONCTION variable is not useful.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var SYNCHRO_RELATION_CONTACT = 2,
SYNCHRO_RELATION_FONCTION = ??? KEY,
SYNCHRO_RELATION_PREFERENCE = 24,
TABLEID_CONTACTS = 11000,
TABLEID_FONCTIONS = 51000,
TABLEID_PROFILES = 24000,
LK_PROF_FLEXKIND_PREFERENCE = '2',
SYNC_D_CHANGE_ERROR = 10 / 86400,
APPID_SYNCSERVER = 27,
TIMEZONE_UTC = 100,
TIMEZONE_ROMANCE = 172, //172 = GMT+1
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5262/what-the-value-synchrorelationcontact-constant-flexmail</guid>
<pubDate>Mon, 27 Jan 2020 17:16:25 +0000</pubDate>
</item>
<item>
<title>IE configuration for self-signed certificate(HTTPS)</title>
<link>https://overflow.efficy.io/?qa=5199/ie-configuration-for-self-signed-certificate-https</link>
<description>&lt;p&gt;IE configuration to avoid having a sidebar error message(HTTP Error 12057 - SSL Revocation) if you use a HTTPS certified self-signed&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Internet Explorer.&lt;/li&gt;
&lt;li&gt;From the Tools menu, select the menu item Internet Options and click on the Advanced tab.&lt;/li&gt;
&lt;li&gt;Scroll down to the Security section, uncheck the option Check for server certificate revocation.&lt;/li&gt;
&lt;li&gt;Click on the OK button to close the Internet Options dialog.  You also need to close all instances of Internet Explorer for the changes to take effect.  If the changes do not take effect, it is possible a hidden instance of Internet Explorer may still be running in the background. In this case, just reboot your computer and it will work.&lt;/li&gt;
&lt;li&gt;If you still get this error, turn off the other option Check for publisher's certificate revocation.&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5199/ie-configuration-for-self-signed-certificate-https</guid>
<pubDate>Wed, 15 Jan 2020 13:20:03 +0000</pubDate>
</item>
<item>
<title>Timesheet notification icon</title>
<link>https://overflow.efficy.io/?qa=4567/timesheet-notification-icon</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;On the right bar in Efficy, on the TIMESHEET button, there is an &quot;!&quot; icon that I cannot get rid of, why is it here and how can I remove it ?&lt;/p&gt;

&lt;p&gt;I have no use for the timesheet feature.&lt;/p&gt;

&lt;p&gt;Kind regards&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4567/timesheet-notification-icon</guid>
<pubDate>Mon, 30 Sep 2019 07:52:26 +0000</pubDate>
</item>
<item>
<title>Gamification Metric - Quizz</title>
<link>https://overflow.efficy.io/?qa=4823/gamification-metric-quizz</link>
<description>&lt;p&gt;Hello again&lt;/p&gt;

&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I have set a new challenge with two metrics.&lt;br&gt;
The first metric is exactly the same SQL as in the online doc:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;`
SELECT COUNT(*) + &amp;lt;#gamlastscore&amp;gt;

FROM &amp;lt;#table name=OPPORTUNITIES&amp;gt; O

WHERE O.OPENED  = 1

AND EXISTS (SELECT K_USER FROM &amp;lt;#table name=OPPO_USER&amp;gt; OU WHERE O.K_OPPORTUNITY = OU.K_OPPORTUNITY AND K_USER=&amp;lt;#gamplayerid&amp;gt; and isactive='1') 

AND O.D_CREATE &amp;gt;= TO_DATE('&amp;lt;#gamchalbegin&amp;gt;', 'yyyy/mm/dd hh24:mi:ss') 

AND O.D_CREATE &amp;gt; TO_DATE('&amp;lt;#gamlastdate&amp;gt;', 'yyyy/mm/dd hh24:mi:ss') 

[Options]

NativeSql=1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;`&lt;/p&gt;

&lt;p&gt;The second metric is a quizz containing two questions.&lt;br&gt;
How does the Quizz metric work  if I wish to allocate 10 points for each correct answer ?&lt;br&gt;
Any concrete example of the use of metric for Quizz will be welcome..to make the most out of this great new module...&lt;/p&gt;

&lt;p&gt;Thanks&lt;br&gt;
Patrice&lt;/p&gt;

&lt;p&gt;*PS:a few additional examples within the online doc would help a lot (and/or an online tuto...) as I feel the current doc is not enough to understand the use of metrics and calculation of results (&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.com/edn/dev/crft_11_gam_introduction)*&quot;&gt;https://help.efficy.com/edn/dev/crft_11_gam_introduction)*&lt;/a&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4823/gamification-metric-quizz</guid>
<pubDate>Tue, 24 Sep 2019 10:57:00 +0000</pubDate>
</item>
<item>
<title>Gamification Design</title>
<link>https://overflow.efficy.io/?qa=4822/gamification-design</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;Starting to implement the gamification module for a sales promotion starting this week.&lt;br&gt;
I went deeply through  the dev guide but still have some questions that should be share with the Efficy community (&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.com/edn/dev/crft_11_gam_introduction)&quot;&gt;https://help.efficy.com/edn/dev/crft_11_gam_introduction)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is it possible to change the design of the map ? Does Efficy propose (off the package) other graphics ?&lt;/p&gt;

&lt;p&gt;If within a challenge, a new quizz starts, how can we alert the players ? &lt;br&gt;
Do they have to enter in the game dashboard everyday to check if a new quizz is to be answered.&lt;/p&gt;

&lt;p&gt;Thanks&lt;br&gt;
Patrice&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4822/gamification-design</guid>
<pubDate>Tue, 24 Sep 2019 10:46:43 +0000</pubDate>
</item>
<item>
<title>Undo the confidential state for a company</title>
<link>https://overflow.efficy.io/?qa=4814/undo-the-confidential-state-for-a-company</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;In the efficy 10 SP2 environment, how can we undo the confidential state for a company (or any other entity)?&lt;/p&gt;

&lt;p&gt;I know you can overcome this by making an action private first and then making it public, but let's assume this is not possible.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

&lt;p&gt;Ken&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4814/undo-the-confidential-state-for-a-company</guid>
<pubDate>Tue, 17 Sep 2019 10:38:46 +0000</pubDate>
</item>
<item>
<title>Fragments error(solution)</title>
<link>https://overflow.efficy.io/?qa=4709/fragments-error-solution</link>
<description>&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=18444636086832228680&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;Procedure to follow in order not to reproduce the error message above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create Template (.docx type Quotation)&lt;br&gt;
The tempate needs to have a GetTable with an empty table like this : &lt;br&gt;
[$GetTable(PROD)]&lt;br&gt;
[/$]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create/Add Fragments &lt;br&gt;
Ex: Product, Title, Total&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create Opportunity (fill in required fields)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Link Template and Apply (from Oppo)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add your Fragments &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Generate Quotation&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;link of the case with the template test and additional documentation:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://submariners.efficy.com/crm/view/Case/104767&quot;&gt;CFT-2019-102239&lt;/a&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4709/fragments-error-solution</guid>
<pubDate>Wed, 14 Aug 2019 08:26:53 +0000</pubDate>
</item>
<item>
<title>Settings for AutoMailUploader with Exchange on-prem</title>
<link>https://overflow.efficy.io/?qa=4632/settings-for-automailuploader-with-exchange-on-prem</link>
<description>&lt;p&gt;Did anybody make the above possible to run?&lt;/p&gt;

&lt;p&gt;No matter which port or encryption method I am using, I get Socket (10054) errors, wrong SSL version or similar. The Exchange Sync Service is running very fine, but not the impersonation for Automatic Mails Upload.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4632/settings-for-automailuploader-with-exchange-on-prem</guid>
<pubDate>Wed, 31 Jul 2019 16:45:21 +0000</pubDate>
</item>
<item>
<title>how using the maintenance mode with version 11.2 and +</title>
<link>https://overflow.efficy.io/?qa=4571/how-using-the-maintenance-mode-with-version-11-2-and</link>
<description>&lt;p&gt;The maintenance mode don't existe anymore into the console Efficy. &lt;br&gt;
how can we activate it ? The both option save state and restore state are still there. but not the stop and start options&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=15232567265098024444&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4571/how-using-the-maintenance-mode-with-version-11-2-and</guid>
<pubDate>Tue, 16 Jul 2019 14:01:53 +0000</pubDate>
</item>
<item>
<title>How to use ImportUserPasswords</title>
<link>https://overflow.efficy.io/?qa=4484/how-to-use-importuserpasswords</link>
<description>&lt;p&gt;How to use the utility to import userpasswords. Is there a template file or something?&lt;/p&gt;

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

&lt;p&gt;Rob&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4484/how-to-use-importuserpasswords</guid>
<pubDate>Mon, 24 Jun 2019 11:14:11 +0000</pubDate>
</item>
<item>
<title>Report of actions/visit to Word</title>
<link>https://overflow.efficy.io/?qa=4177/report-of-actions-visit-to-word</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;Is there a way to use the Report module to produce a docx document (based on a template) in order to generate a report showing all actions (visits) of the previous week ?&lt;/p&gt;

&lt;p&gt;I think this is achievable using the campaign functions but it can be &quot;complicated&quot; for users to go through the different step.&lt;br&gt;
The report module seems to be able to do the job using Crystal Reports..but we haven't gone for this reporting solution - we went for Qlik...&lt;/p&gt;

&lt;p&gt;One of the solution purchased by Efficy (Vente Partner) was doing this job very easily.&lt;br&gt;
Clicking on a customized button, a csv file was exported to the local PC and then a .dot word document was automaticaly opened. A vba code was automatically launching a merging using the csv data...et voilà, report of the done week for the sales manager !&lt;/p&gt;

&lt;p&gt;Any simple way to do something similar with Efficy ?&lt;/p&gt;

&lt;p&gt;Patrice - MX France &lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4177/report-of-actions-visit-to-word</guid>
<pubDate>Fri, 10 May 2019 13:23:56 +0000</pubDate>
</item>
<item>
<title>Datasynchro Export to CSV</title>
<link>https://overflow.efficy.io/?qa=4142/datasynchro-export-to-csv</link>
<description>&lt;p&gt;I'm looking for an example how to export Efficy content to CSV File using Datasynchro&lt;br&gt;
In Efficy Help I found only an example to export to Excel file&lt;/p&gt;

&lt;p&gt;Thanks &lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4142/datasynchro-export-to-csv</guid>
<pubDate>Wed, 24 Apr 2019 08:39:17 +0000</pubDate>
</item>
<item>
<title>Steps for Customers to create the correct API which can be used</title>
<link>https://overflow.efficy.io/?qa=4072/steps-for-customers-to-create-the-correct-api-which-can-used</link>
<description>&lt;p&gt;Do we have a manual for customers how to create the correct API for using the Efficy &quot;Show  Map&quot; option?&lt;/p&gt;

&lt;p&gt;Where to find a English manual which is still valid as of today?&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4072/steps-for-customers-to-create-the-correct-api-which-can-used</guid>
<pubDate>Thu, 28 Mar 2019 09:25:42 +0000</pubDate>
</item>
<item>
<title>install Gmail integration with Efficy 11.2 and latest sidebar version (11.2.16945)</title>
<link>https://overflow.efficy.io/?qa=4070/install-gmail-integration-efficy-latest-sidebar-version-16945</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;in the current sidebar installation file (Version 11.2.16945) and I guess also in some previous 11.2 sidebar versions, I could not find the Option to install the gmail integration.&lt;/p&gt;

&lt;p&gt;How do I install the gmail integration for Efficy 11.2 or is for a certain reason this integration now unavailable?&lt;/p&gt;

&lt;p&gt;Thanks in advance and best regards&lt;/p&gt;

&lt;p&gt;Stephan&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4070/install-gmail-integration-efficy-latest-sidebar-version-16945</guid>
<pubDate>Wed, 27 Mar 2019 10:18:47 +0000</pubDate>
</item>
<item>
<title>Efficy 11 - Saving mail to efficy only works for administrators in Mac environment</title>
<link>https://overflow.efficy.io/?qa=4050/efficy-saving-mail-efficy-works-administrators-environment</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;A client using Build 11.0.12921 and using a Mac environment is experiencing troubles when saving an email to efficy.&lt;/p&gt;

&lt;p&gt;The sidebar works and the plugin is availbale, however when the user tries to save a mail nothing happens.&lt;br&gt;
But when a user is in the administrator group, the functionality works fine.&lt;/p&gt;

&lt;p&gt;I haven't found anything in the custom that would explain this.&lt;/p&gt;

&lt;p&gt;Below the settings for the admin group and one of a group which doesn't work.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=14110688774357919075&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=559147489466404732&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;Any suggestions on where to look are appreciated.&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4050/efficy-saving-mail-efficy-works-administrators-environment</guid>
<pubDate>Thu, 21 Mar 2019 12:39:13 +0000</pubDate>
</item>
<item>
<title>No customer allowed on this host</title>
<link>https://overflow.efficy.io/?qa=3984/no-customer-allowed-on-this-host</link>
<description>&lt;p&gt;I try to install the new release on a local server but I have each time I try to connect to the server this message.&lt;/p&gt;

&lt;p&gt;No customer allowed on this host&lt;/p&gt;

&lt;p&gt;I added into &quot;customer and Guest Manager&quot; tool, the customer with the authorized URL but I still have this bug. Any idea of the problems ?&lt;br&gt;
The tests into the admin console seem ok.  &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=17995756944562845095&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3984/no-customer-allowed-on-this-host</guid>
<pubDate>Mon, 25 Feb 2019 09:23:11 +0000</pubDate>
</item>
<item>
<title>Why the chronos in custom entities record only the last record, not all records changed</title>
<link>https://overflow.efficy.io/?qa=3942/chronos-custom-entities-record-only-record-records-changed</link>
<description>&lt;p&gt;I configured the Chronos for a new entity into designer then into the InitSysChanged utility. It's seem working when I add links but not for the entity itself.&lt;br&gt;
I have a problem for main table. Fields I choose to follow into the chronos are only referenced at the last value.&lt;/p&gt;

&lt;p&gt;In the standard entities the the field found into history are followed into the chronos as into history.&lt;/p&gt;

&lt;p&gt;In this screenshot you can see that the customer changed 3 time the field Phase. (show history) But only the last one appear into the chronos. &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=4769858297465608263&quot; alt=&quot;History vs Chonos&quot;&gt; &lt;/p&gt;

&lt;p&gt;What I forgotten ? It's a bug ? Not available for custom ? &lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3942/chronos-custom-entities-record-only-record-records-changed</guid>
<pubDate>Mon, 11 Feb 2019 13:15:04 +0000</pubDate>
</item>
<item>
<title>Crystal report : output word format</title>
<link>https://overflow.efficy.io/?qa=3801/crystal-report-output-word-format</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;what I need to write in the memo of a crystal report to force the output in Word format ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3801/crystal-report-output-word-format</guid>
<pubDate>Tue, 08 Jan 2019 10:58:18 +0000</pubDate>
</item>
<item>
<title>Favorites management</title>
<link>https://overflow.efficy.io/?qa=3821/favorites-management</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have split the PRODUCTS table in two entities and now I have a problem with their favorites :&lt;br&gt;
- Products are records with FAMILY &amp;lt;&amp;gt; 1 (K&lt;em&gt;ENTITY=30)&lt;br&gt;
- Missions are records with FAMILY  =  1 (K&lt;/em&gt;ENTITY=50)&lt;br&gt;
Both have K&lt;em&gt;TABLE=30000 in SYS&lt;/em&gt;ENTITIES&lt;/p&gt;

&lt;p&gt;The favorites grid displays the same records for Products and Missions.&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=6425433143983569954&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;With the post of  Kristof Pauwels I know that they are stored in the FAVORITES table.&lt;br&gt;
I suppose that Efficy look the K_TABLE to know the Entity and it's why there are all Products&lt;/p&gt;

&lt;p&gt;What can I customize to apply a filter ? I search but I can't find a Query.&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=14747897987707469354&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;The grid&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=106685424159539364&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;using Efficy 10.2&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3821/favorites-management</guid>
<pubDate>Mon, 07 Jan 2019 09:05:15 +0000</pubDate>
</item>
<item>
<title>Document and Opportunity model : add property like 'EditEntityGridActi'</title>
<link>https://overflow.efficy.io/?qa=3721/document-opportunity-model-property-editentitygridacti</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Efficy version : 10.2&lt;/p&gt;

&lt;p&gt;In the TabContentProds (Edit window of Documents and Opportunities), I need that the client scripts in MacroEditS do some computations following the value of some fields of PRODUCTS&lt;br&gt;
I mean for example the have to do &lt;strong&gt;2+2 if PRODUCTS.FAMILY==1&lt;/strong&gt; or &lt;strong&gt;2*2 if PRODUCTS.FAMILY != 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But, &lt;strong&gt;I do not want to&lt;/strong&gt; put the value of PRODUCTS.FAMILY in the html (example) :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;tr class=&quot;mission&quot; data-family=&amp;lt;#F=FAMILY;nospace=T&amp;gt; [...] &amp;lt;/tr&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and use it in MacroEditS like&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$('.mission').each(function() {
  var family = $(this).data('family');
})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I would prefer to use the Model, is it possible to add &lt;strong&gt;'EditEntityGridProd'&lt;/strong&gt; like &lt;strong&gt;'EditEntityGridActi'&lt;/strong&gt; in &lt;strong&gt;'JsonEditModel.Docu/editEntityGrids'&lt;/strong&gt; ?&lt;/p&gt;

&lt;p&gt;Am I obliged to use &lt;strong&gt;'&amp;lt;%GetRelationGrid([...])%&amp;gt;'&lt;/strong&gt; in the Model ? This function tag is already used to generate the html grid in 'TabContentProds' so can I not generate this part of the model here ?&lt;/p&gt;

&lt;p&gt;Last question : How to access it in the script ?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// 1 because I will place it in the array after EditEntityGridActi
var ProductsData = Model('editEntityGrids[1]')
// or
var ProductsData = Model('editEntityGrids')[1]
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3721/document-opportunity-model-property-editentitygridacti</guid>
<pubDate>Fri, 07 Dec 2018 11:40:49 +0000</pubDate>
</item>
<item>
<title>Argmuents/Variables in custom function template</title>
<link>https://overflow.efficy.io/?qa=3586/argmuents-variables-in-custom-function-template</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;On the Opportunity, in the grid of the companies I want to add the CmdCreateProposal in the grid menu to create launch a template for a specific company.&lt;/p&gt;

&lt;p&gt;In my template I call a custom function to generate table (stored in the db conf)&lt;br&gt;
[$RunScript(name=&quot;GetCustomWordTable&quot;, file=&quot;CustomTemplate&quot;)]&lt;/p&gt;

&lt;p&gt;The function GetCustomWordTable use Variables.Values('Comp'); but I'm not able to get the key.&lt;/p&gt;

&lt;p&gt;How can I pass the key of the company ? I tried with this :&lt;/p&gt;

&lt;p&gt;Below Comp = literally 'Arguments.Values(&quot;Comp&quot;)'&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[$RunScript(name=&quot;GetCustomWordTable&quot;, file=&quot;CustomTemplate&quot;, Comp=Arguments.Values(&quot;Comp&quot;))]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Below, In my script Comp = ''&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[$RunScript(name=&quot;GetCustomWordTable&quot;, file=&quot;CustomTemplate&quot;, Arguments.Values(&quot;Comp&quot;))]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To try I customized the consultToolsCmd.js/proposal() function and use this macro in the word template :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function proposal() {
    InstantDocument(Element, Model('bookmark'), format(&quot;Oppo={key}&quot;+'&amp;amp;Comp=18'));
    if (Model('detail') != 'Docu') {
        Browser.navigate(Model('hrefDetailDocu'));
    }
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3586/argmuents-variables-in-custom-function-template</guid>
<pubDate>Wed, 03 Oct 2018 08:08:00 +0000</pubDate>
</item>
<item>
<title>How to know if a PROD_OPPO relation exists based on DOCU_PROD</title>
<link>https://overflow.efficy.io/?qa=3499/how-to-know-if-prodoppo-relation-exists-based-on-docuprod</link>
<description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;When I commit Document I have to update product on Opportunity :&lt;br&gt;
- if a Docu&lt;em&gt;Prod is remove I want to remove it from the PROD&lt;/em&gt;OPPO&lt;br&gt;
- if a Docu&lt;em&gt;Prod is update I have to update PROD&lt;/em&gt;OPPO&lt;br&gt;
- if a Docu&lt;em&gt;Prod is added I have to insert it in the PROD&lt;/em&gt;OPPO&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;important notes :&lt;br&gt;
- insert copy DOCU&lt;em&gt;PROD.K&lt;/em&gt;RELATION in PROD&lt;em&gt;OPPO.K&lt;/em&gt;RELATION&lt;br&gt;
- PROD&lt;em&gt;OPPO have a F&lt;/em&gt;K&lt;em&gt;DOCUMENT field which contains the K&lt;/em&gt;DOCUMENT to know which Document linked it&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Unless I'm wrong, in the After or BeforeCommitDocu event, with GetDetailDataSet(EditHandle, ntProd) we are not able to know the removed relation, so, to remove the product on the Opportunity my workflow (example with Oppo as container) get:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Trigger AfterCommitDocu(EditHandle)&lt;/li&gt;
&lt;li&gt;Check the container (ntOppo op ntProj based on the reference of the document)&lt;/li&gt;
&lt;li&gt;Get the container key and open the edit context (containerEdit)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;First I check the products to delete on the Oppo :&lt;br&gt;
 4.1 Execute an SQL Query to get the products of the Oppo&lt;br&gt;
 4.2 Iterate through the result Dataset&lt;br&gt;
 4.3 To check if the product is not in the document I use PositionDetail(EditHanle) (cf workflow below)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Link and update products of the document&lt;/li&gt;
&lt;li&gt;If the container is an Opportunity I update its BUDGET&lt;/li&gt;
&lt;li&gt;Commit the changes of the Oppo&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have just a problem in the 5th bullet point : PositionDetail always return false and at the and all the PROD_OPPO obtained with the request are deleted.&lt;br&gt;
I think the CommitChanges calls all InsertDetails first, and then DeleteDetail..&lt;/p&gt;

&lt;p&gt;Why PositionDetail is not able to return me true ? I checked with the Logger and and the K&lt;em&gt;PRODUCT and K&lt;/em&gt;RELATION are correct. I can not find example of PositionDetail (edn, standard code, ...)&lt;/p&gt;

&lt;p&gt;P.S : in DeleteProdOnContainer what is the better way to delete the record ? Database.DeleteDetail() or or the TDataSet.delete() method ?&lt;/p&gt;

&lt;p&gt;Workflow :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// called by AfterCommitDocu
function GestionDocuProd(EditHandle, Inserted) {
  var containerHandle=0;
  var Ref = Database.GetFieldValue(EditHandle, 'REFERENCE');

  // update Oppo or Proj ?
  switch(true) {
    case /^D\d+$/.test(Ref) : // DEVIS
      // pas de traitement si Devis final
      if(Database.GetFieldValue(EditHandle, 'F_STATUS') == 5) {
        return;
      }
      containerHandle = ntOppo;
      break;
    case /^IPC/.test(Ref) : // COMMANDE
      containerHandle = ntProj;
      break;
    default:
      return;
      break;
  }

  // key of the container : Devis ==&amp;gt; Opportunity || IPC ==&amp;gt; Project
  var containerKey = Database.GetMainDetail(EditHandle, containerHandle);

  // Erreur si pas de container
  if(containerKey==0) {
    if(containerHandle==ntOppo) {
      throw new Error(&quot;This type of document must be linked to a container (devis = opportunity) / Le document doit être lié a un container (devis = Opportunité&quot;);
    }
    else if(containerHandle==ntProj) {
      throw new Error(&quot;This type of document must be linked to a container (Commande / IPC = Dossier) / Le document doit être lié a un container (Commande / IPC = Dossier&quot;);
    }
  }

  // Document key and container Edit context
  var docuKey = Database.GetEditKey(EditHandle);
  var containerEdit = Database.OpenEditContext(containerHandle, containerKey);

  Database.CopyDetails(containerEdit, EditHandle, [ntCont, ntComp, ntProf], false, false);

  try {
    /* delete product on Oppo/Proj */
    DeleteProdOnContainer(containerEdit, containerKey, EditHandle, docuKey);

    /* Insert &amp;amp; Update product */
    UpdateProdOnContainer(EditHandle, Ref, containerHandle, containerEdit)

    if(containerHandle == ntOppo) {
      Database.CommitChanges(containerEdit, true); // persist link to update BUDGET

      // Get new BUDGET
      var SQLGetNewBudget = &quot;Select Coalesce(Sum(TOTAL),0) as BUDGET from &amp;lt;#TABLE NAME='PROD_OPPO'&amp;gt; where K_OPPORTUNITY=:param1 and F_LOT &amp;lt;&amp;gt; K_PRODUCT&quot;;
      var result = ExecuteQuery(SQLGetNewBudget, containerKey);
      var newBudget = result.FieldByName('BUDGET').AsFloat || 0;

      // Update
      Database.UpdateField(containerEdit, 0, 'BUDGET', newBudget);
    }

    Database.CommitChanges(containerEdit, false);
  }
  finally {
    Database.CloseContext(containerEdit);
  }
}
function DeleteProdOnContainer(ContainerEdit, ContainerKey, DetailEdit, K_DOCUMENT) {
  var SQLGetProducts = &quot;select * from &amp;lt;#TABLE NAME=\&quot;PROD_OPPO\&quot;&amp;gt; where K_OPPORTUNITY=:param1 and F_K_DOCUMENT=:param2&quot;;
  var params = ContainerKey+'\n'+K_DOCUMENT;

  var prodDS = ExecuteQuery(SQLGetProducts, params);

  if(!prodDS.IsEmpty) {
    prodDS.First

    while(!prodDS.EoF) {
      var k_product = prodDS.FieldByName('K_PRODUCT').AsFloat;
      var k_relation = prodDS.FieldByName('K_RELATION').AsFloat;
      var k_lot = prodDS.FieldByName('F_LOT').AsFloat;
      var k_opportunity = prodDS.FieldByName('K_OPPORTUNITY').AsFloat;

      var debugStr = 'RELATION OPPO_PROD ' + k_opportunity+'-'+k_product + '('+k_relation+') from Batch ' + k_lot

      // if current PROD_OPPO/PROD_PROJ don't exists on Document ==&amp;gt; delete on Oppo
      if(!Database.PositionDetail(DetailEdit, ntProd, k_product, k_relation)) {

        // What is better ? delete() or DeleteDetail() ?
        // prodDS.delete();
        //Logger.Write('Delete Oppo-Prod 136-' + k_product + '('+k_relation+')');
        debugStr += ' | DELETE'

        Database.DeleteDetail(ContainerEdit, ntProd, k_product, k_relation);
      }
      Logger.Write(debugStr);
      prodDS.Next;
    }
  }
  else {
    Logger.Write('No product on container');
  }
}
// insert and/or update PROD_OPPO from current DOCU_PROD
function UpdateProdOnContainer(EditHandle, Ref, containerHandle, ContainerEdit) {
  var docuProdDataSet = Database.GetDetailDataSet(EditHandle, ntProd);
  if(!docuProdDataSet.IsEmpty) {
    docuProdDataSet.First;
    // fields to copy
    var FieldList = [&quot;QUANTITY&quot;, &quot;PRICE&quot;, &quot;TOTAL&quot;, &quot;F_LOT&quot;];

    if(containerHandle==ntOppo) { // PROD_OPPO have more field to copy than PROD_PROJ
      FieldList = FieldList.concat([&quot;RATE&quot;, &quot;DISCOUNT&quot;, &quot;VAT&quot;, &quot;CONSO_RATE&quot;, &quot;CONSO_TOTAL&quot;]);
    }

    while(!docuProdDataSet.EoF) {
      var prodKey = docuProdDataSet.FieldByName(&quot;K_PRODUCT&quot;).AsFloat;
      var relKey = docuProdDataSet.FieldByName(&quot;K_RELATION&quot;).AsFloat;
      Database.InsertDetail(ContainerEdit, ntProd, prodKey, relKey, false);

      // copy relation fields value
      for (var i = 0; i &amp;lt; FieldList.length; i++) {
        Database.UpdateDetailField(ContainerEdit, ntProd, 0, relKey, FieldList[i], docuProdDataSet.FieldByName(FieldList[i]).AsFloat);
      }
      Database.UpdateDetailField(ContainerEdit, ntProd, 0, relKey, 'F_K_DOCUMENT', docuProdDataSet.FieldByName('K_DOCUMENT').AsFloat);  // --&amp;gt; which document have linked the product
      Database.UpdateDetailStringField(ContainerEdit, ntProd, 0, relKey, 'F_DOCUREF', Ref);  // --&amp;gt; easy way to get the Document reference in the Opportunity.Products grid
      Database.UpdateDetailStringField(ContainerEdit, ntProd, 0, relKey, 'COMMENT', docuProdDataSet.FieldByName('COMMENT').AsString);

      docuProdDataSet.Next;
    }
  }
  else {
    Logger.Write('No product on document');
  }
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3499/how-to-know-if-prodoppo-relation-exists-based-on-docuprod</guid>
<pubDate>Mon, 03 Sep 2018 15:25:20 +0000</pubDate>
</item>
<item>
<title>Use MS SQL &quot;CASE&quot; in SYS_TABLEVIEWS</title>
<link>https://overflow.efficy.io/?qa=3469/use-ms-sql-case-in-systableviews</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I put my customization at the bottom&lt;br&gt;
Some product can be a batch (Product that contains other Products) (PROD&lt;em&gt;PROD : K&lt;/em&gt;PRODUCT = Batch, K_PRODUCT2 = Simple product)&lt;br&gt;
Note : a Batch have FAMILY = 1, other product have other value (can be empty)&lt;/p&gt;

&lt;p&gt;I customized the DocuEdit window : when a product is linked, the WF checks if FAMILY=1 and then it link all products to the Document&lt;br&gt;
--&amp;gt; DOCU&lt;em&gt;PROD have a custom field &quot;F&lt;/em&gt;LOT&quot; that contains the K_PRODUCT of the Batch (can be NULL too)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important to notice :&lt;br&gt;
- I configured LK&lt;em&gt;PROD&lt;/em&gt;FAMILY.K&lt;em&gt;SORT to help me to order the display :&lt;br&gt;
ID | K&lt;/em&gt;SORT | FAMILY&lt;br&gt;
1  |   4    |  Batch&lt;br&gt;
2  |   1    |  Presta&lt;br&gt;
3  |   2    |  Option&lt;br&gt;
4  |   3    |  Expense&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I want to customize the grid (macros) and the display order of products on DocuEdit like this :&lt;br&gt;
Products of Batch 1 (Family &amp;lt;&amp;gt; 1; F&lt;em&gt;LOT=K&lt;/em&gt;PRODUCT of Batch 1) order by NAME&lt;br&gt;
Batch 1 (Family = 1; F&lt;em&gt;LOT = its K&lt;/em&gt;PRODUCT)&lt;br&gt;
Products of Batch 2 (Family &amp;lt;&amp;gt; 1; F&lt;em&gt;LOT=K&lt;/em&gt;PRODUCT of Batch 2) order by NAME&lt;br&gt;
Batch 2 (Family = 1; F&lt;em&gt;LOT = its K&lt;/em&gt;PRODUCT)&lt;br&gt;
Product directly linked to Document (F_LOT = NULL) order by NAME&lt;/p&gt;

&lt;p&gt;To do this I have to customize SYS&lt;em&gt;TABLEVIEWS.Docu&lt;/em&gt;Prod (K_TABLE = 31030). The pure MS SQL I need is :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;select Prod.NAME, Prod.FAMILY, DP.*
    from DOCU_PROD DP
    join PRODUCTS Prod on DP.K_PRODUCT=Prod.K_PRODUCT
    join LK_PROD_FAMILY family on Prod.FAMILY=family.K_PROD_FAMILY
    where DP.K_DOCUMENT=@DocumentID
    order by case when DP.F_LOT is null then 1 else 0 end, /* product linked directly to Document at bottom (F_LOT=NULL) */
        DP.F_LOT,   /* order by Batch */
        family.K_SORT, /* family.K_SORT=1 --&amp;gt; Presta, family.K_SORT=2 --&amp;gt; Option, family.K_SORT=3 --&amp;gt; Expense, family.K_SORT=4 --&amp;gt; Batch */
        Prod.NAME /* the products are listed by NAME */
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have 2 problems :&lt;/p&gt;

&lt;p&gt;1) USE CASE IN SYS&lt;em&gt;TABLEVIEWS :&lt;br&gt;
To use &quot;CASE&quot; in SYS&lt;/em&gt;TABLEVIEWS I translated it like this :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SELECTFROM='DOCU_PROD DOCU_PROD, PRODUCTS PRODUCTS, LK_PROD_FAMILY LK_PROD_FAMILY'
SELECTFIELDS='DOCU_PROD.*, PRODUCTS.NAME, PRODUCTS.OPENED, PRODUCTS.FAMILY'
SELECTJOIN='DOCU_PROD.K_PRODUCT = PRODUCTS.K_PRODUCT, PRODUCTS.FAMILY=LK_PROD_FAMILY.K_PROD_FAMILY'
SELECTORDERBY='&amp;lt;#IFDB DB=&quot;MS&quot; THEN=&quot;case when DP.F_LOT is null then 1 else 0 end, &quot;&amp;gt;DOCU_PROD.F_LOT, LK_PROD_FAMILY.K_SORT, PRODUCTS.NAME'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Problem 1 : SYS&lt;em&gt;TABLEVIEWS don't support neither pure MS SQL (case) nor IFDB query tag. How can I use CASE in SYS&lt;/em&gt;TABLEVIEWS ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I tried to use this query in a RunQuery in MacroEditCustom.txt and call it in TabContentProds, but I can't : this request looks directly in the DB, but when a user add a product, the application don't persist the relations in the DB until the user clicks the save/apply button, so the DocuEdit is refresh but the user can't see nothing.&lt;/p&gt;

&lt;p&gt;2) Use FAMILY and F_LOT to define style&lt;br&gt;
To insert the products on the Document, the WF use InsertDetail() and some UpdateDetail() without CommitChanges (if I use it, the relations will be persisted and the &quot;cancel&quot; button don't delete these links)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem 2 : the overriden columns definitions use F_LOT and FAMILY to set css classes, etc. It seems hat Efficy can't find FAMILY until the relations have not been commited.&lt;/strong&gt;&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=12218006850585471763&quot; alt=&quot;enter image description here&quot;&gt;&lt;br&gt;
On the screen :&lt;br&gt;
- FAMILY = R_FAMILY ; LOT = F_LOT ; FAM = LK_PROD_FAMILY.K_SORT&lt;br&gt;
- The first 3 lines are already in the DB, and F_LOT=39, so they must be ordered by FAM&lt;br&gt;
    ==&amp;gt; why '39 - Lot 2' is the first line and not the third ? After search a bit, It like Efficy sort them by K_RELATION and ignore SELECTORDERBY&lt;br&gt;
- others have not been comitted in the DB, so Efficy can't find the value of FAMILY&lt;br&gt;
    ==&amp;gt; how can I set the my css classes in macros ?&lt;/p&gt;

&lt;p&gt;CUSTOMIZATIONS :&lt;br&gt;
Current SYS&lt;em&gt;TABLEVIEWS.Docu&lt;/em&gt;Prod :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;update SYS_TABLEVIEWS
    set ISCUSTOM=1,
    SELECTFROM='DOCU_PROD DOCU_PROD, PRODUCTS PRODUCTS, LK_PROD_FAMILY LK_PROD_FAMILY',
    SELECTFIELDS='DOCU_PROD.*, PRODUCTS.NAME, PRODUCTS.OPENED, PRODUCTS.FAMILY, LK_PROD_FAMILY.K_SORT FAM',
    SELECTJOIN='DOCU_PROD.K_PRODUCT = PRODUCTS.K_PRODUCT, PRODUCTS.FAMILY=LK_PROD_FAMILY.K_PROD_FAMILY',
    SELECTORDERBY='DOCU_PROD.F_LOT, LK_PROD_FAMILY.K_SORT, PRODUCTS.NAME'
    where NAME='Docu_Prod'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;InsertBatchChildren()&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function OnInsertDetailDocuProd(EditHandle, Detail, DetailKey) { 
  InsertBatchChildren(EditHandle, Detail, DetailKey) 
}
function InsertBatchChildren(EditHandle, Detail, BatchKey) {
  var prodConsult = Database.OpenConsultContext(ntProd);
  try {
    // get family of current product
    var batchDS = Database.Consult(prodConsult, BatchKey, false),
    family = batchDS.FieldByName(&quot;FAMILY&quot;).asInteger;

    // don't do anything if it's not a Batch
    if (family != GLOBAL.LK_PROD_FAMILY.BATCH) return;

    // else set its F_LOT and FAMILY and link its children
    Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;F_LOT&quot;, BatchKey); // define Batch F_LOT
    Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;FAMILY&quot;, family); // define Batch F_LOT
    //TO DO : define K_SORT Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;K_SORT&quot;, int); // define Batch K_SORT

    var queryHandle,
        childrenDS = Database.ConsultDetail(queryHandle, prodConsult, BatchKey, ntProd, false, true, 0);

    childrenDS.First;
    while (!childrenDS.Eof) {
      var k_product = childrenDS.fieldByName(&quot;K_PRODUCT&quot;).AsFloat;
      Logger.Write(&quot;Inserting &quot; + k_product + &quot; from &quot; + BatchKey);
      Database.InsertDetail(EditHandle, ntProd, k_product, -1, false);                                    // insert Batch child on Document
      Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;NAME&quot;, childrenDS.fieldByName(&quot;NAME&quot;).asString);  // define child NAME
      Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;F_LOT&quot;, BatchKey);                                // define child F_LOT
      Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;COMMENT&quot;, &quot;Inserted from WORKFLOW&quot;);              // define child COMMENT

      // Update FAMILY in DOCU_PROD
      var childFamily= childrenDS.fieldByName(&quot;FAMILY&quot;).AsInteger; // ERROR : &quot;Field 'FAMILY' not found&quot;
      Logger.Write(&quot;childFamily=&quot;+childFamily);
      Database.UpdateDetail(EditHandle, ntProd, 0, -1, &quot;FAMILY&quot;, childFamily);

      childrenDS.Next;
    }
  } finally {
    Database.CloseContext(prodConsult);
  }
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3469/use-ms-sql-case-in-systableviews</guid>
<pubDate>Tue, 14 Aug 2018 09:46:08 +0000</pubDate>
</item>
<item>
<title>custom.js / AddRelation - &quot;half commit&quot;</title>
<link>https://overflow.efficy.io/?qa=3465/custom-js-addrelation-half-commit</link>
<description>&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;I want to customize the AddRelation function in Custom.js :&lt;br&gt;
On document, when a product of type Batch (FAMILY=1) i linked, I want to link all the products that are link to the Batch.&lt;/p&gt;

&lt;p&gt;For the moment, I did it like this :&lt;br&gt;
1) Custom.js call a serverscript (&lt;code&gt;Document.js&lt;/code&gt;)&lt;br&gt;
2) &lt;code&gt;Document.js&lt;/code&gt; check if the product is a batch (&lt;code&gt;FAMILY=1&lt;/code&gt;)&lt;br&gt;
3) if it's a batch, I fill an array that contains one AddRelation url foreach of them&lt;br&gt;
4) Custom.js get the array and caal each AddRelation url.&lt;/p&gt;

&lt;p&gt;It works, but I need to fill a custom field when I do this : &lt;code&gt;F_LOT&lt;/code&gt;. It must contains the &lt;code&gt;K_PRODUCT&lt;/code&gt; of the Batch, but with the AddRelation request, it is fill with NULL value&lt;/p&gt;

&lt;p&gt;I can fill this field with InsertDetail and UpdateDetail but I have a problem :&lt;br&gt;
When the DocuEdit page is refresh, Efficy fail to find the name (blank NAME column)&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=13851015867543971117&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;If I use a &lt;code&gt;CommitChanges(Context, true)&lt;/code&gt; the name are visible, but the relation are registered in the DB so the &quot;cancel' button don't cancel these links..&lt;br&gt;
Here, &quot;Lot 3&quot; is linked with the basic AddRelation call&lt;/p&gt;

&lt;p&gt;Can anyone explain me how the request AddRelation in the dll do this &quot;half commit&quot;?&lt;/p&gt;

&lt;p&gt;Custom.js :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function AddRelation(EditHandle, Bookmark, Entity, Key, Entity2, Key2, RefreshTopWindow) {
  // check if the product is a Batch (group of product)
  if(Entity=='Prod') {
    $.ajax({
      url: &quot;dialog?_macrofile=MacroAjax&amp;amp;_macro=RunScript&amp;amp;file=Document&amp;amp;func=gestionLot&amp;amp;editHandle=&quot;+EditHandle +&quot;&amp;amp;prodKey=&quot;+EscapeName(Key),
      type: &quot;GET&quot;,
      async: false,
      success: function (html, textStatus, jqXHR) {
        if(IsNotEfficyErrorHtml(html, function(errorMsg) {alert(errorMsg)})) {
          var array = html.split(','); // html = string --&amp;gt; convert to array
          console.log(array);
          for(url of array) {
            url = url + &quot;&amp;amp;bookmark=&quot;+Bookmark;
            LocationSet(top.opener, url);
            sleep(100); // --&amp;gt; permet a Efficy de prendre en compte chaque LocationSet
          }
        }
      }
    })
  }

  var URL = &quot;addrelation?edithandle=&quot; + EditHandle + &quot;&amp;amp;bookmark=&quot; + Bookmark + &quot;&amp;amp;entity=&quot; + Entity + &quot;&amp;amp;key=&quot; + EscapeName(Key)
  if (Entity2) URL += &quot;&amp;amp;entity2=&quot; + Entity2 + &quot;&amp;amp;key2=&quot; + EscapeName(Key2)
  if (window.ClickFromPopup)
    LocationSet(window, URL)
  else if (!RefreshTopWindow &amp;amp;&amp;amp; OpenerExists() &amp;amp;&amp;amp; !IsDesktopWindow(top.opener.top)) {
    top.opener.EntityModified = false;
    LocationSet(top.opener, URL)
    CloseTopWindow()
  }
  else
    LocationSet(window, URL)
}

function sleep(milliseconds) {
    var start = new Date().getTime();
    for (var i = 0; i &amp;lt; 1e7; i++) {
        if ((new Date().getTime() - start) &amp;gt; milliseconds){
            break;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;serverscripts/Document.js :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function gestionLot() {
    // get Arguments
    var EditHandle = StrToIntDef(Request.Argument(&quot;editHandle&quot;), 0),
    prodKey = Request.Argument(&quot;prodKey&quot;); // product to link

    var editEntity = Database.GetEditEntity(EditHandle);
    if(editEntity != ntDocu) { // is Docu ?
        return;
    }

    // Check Key
    if(!prodKey || prodKey==0) {
        throw new Error(&quot;Product key undefined / Cle de produit indefini&quot;);
    }

    // get FAMILY of product
    var SQLGetProdFamily = &quot;select FAMILY from &amp;lt;#TABLE NAME='PRODUCTS'&amp;gt; where K_PRODUCT=:param1&quot;;
    var result = ExecuteQuery(SQLGetProdFamily, prodKey);
    if(!result.IsEmpty) {
        result.First;
        FAMILY = result.FieldByName('FAMILY').AsFloat;

        // si lot ==&amp;gt; insertion produits du lot
        if(FAMILY==1) {
            return addProductsFromLot(EditHandle, prodKey);
        }
    }
    else {
        throw new Error(&quot;Can't find the product / resultat vide, Produit introuvable (Key=&quot; + prodKey + &quot;)&quot;);
    }
}

function addProductsFromLot(EditHandle, lotKey) {
    var queryHandle=0;
    var URLs = [];
    var ProdContext = Database.OpenConsultContext(ntProd);
    try {
        // get Products of the batch and link each of them
        var ProdDS = Database.ConsultDetail(queryHandle, ProdContext, lotKey, ntProd, false, true, 0);
        if(!ProdDS.IsEmpty) {
            ProdDS.First;
            while (!ProdDS.Eof) {
                var K_PRODUCT = ProdDS.fieldByName('K_PRODUCT').asFloat;
                Database.InsertDetail(EditHandle, ntProd, K_PRODUCT, -1, false);
                Database.UpdateDetail(EditHandle, ntProd, 0, 0, 'F_LOT', lotKey);
                //URLs.push(&quot;addrelation?edithandle=&quot; + EditHandle + &quot;&amp;amp;entity=Prod&quot; + &quot;&amp;amp;key=&quot; + K_PRODUCT) // addrelation request used by Custom.js to add relation without persist
                ProdDS.Next;
            }   
            Database.CommitChanges(EditHandle, true); // persist changes ==&amp;gt; &quot;Cancel&quot; button don't cancel these relations
        }
    } finally {
        Database.CloseContext(ProdContext);
        return URLs;
    }
}

function ExecuteQuery(SQL, QueryParams, StoreID) {
    var QueryHandle = 0;
    if (StoreID == &quot;&quot;)
        StoreID = 0;

    var testSQL = new String(SQL);
    testSQL = testSQL.toUpperCase();
    if (testSQL.indexOf(&quot;INSERT&quot;, 0) &amp;lt; 0 &amp;amp;&amp;amp; testSQL.indexOf(&quot;DELETE&quot;, 0) &amp;lt; 0 &amp;amp;&amp;amp; testSQL.indexOf(&quot;UPDATE&quot;, 0) &amp;lt; 0 &amp;amp;&amp;amp; testSQL.indexOf(&quot;ALTER&quot;, 0) &amp;lt; 0) {
        var ContextHandle = Database.OpenTemporaryContext();
        try {
            var DS = Database.ExecuteSystemSQLQuery(QueryHandle, ContextHandle, SQL, QueryParams, true, true, StoreID);
            if (!DS.IsEmpty)
                DS.First;
            return DS;
        } catch (e) {
            throw new Error('ExecuteSystemSQLQuery error :' + e.message + &quot;\nSQL: &quot; + SQL + &quot;\nParams: &quot; + QueryParams);
        }
    } else {
        try {
            Database.ExecSQL(SQL, QueryParams, false);
            return true;
        } catch (e) {
            throw new Error('ExecSQL error :' + e.message + &quot;\nSQL: &quot; + SQL + &quot;\nParams: &quot; + QueryParams);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thanks a lot !&lt;/p&gt;
</description>
<category>How to</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3465/custom-js-addrelation-half-commit</guid>
<pubDate>Mon, 13 Aug 2018 13:40:26 +0000</pubDate>
</item>
</channel>
</rss>