<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions in WorkFlow / Serverscript</title>
<link>https://overflow.efficy.io/?qa=questions/developers/customizing-efficy/workflow</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to queue a function call in a workflow script to execute it async?</title>
<link>https://overflow.efficy.io/?qa=7205/how-to-queue-function-call-in-workflow-script-execute-async</link>
<description>&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;I am working on an integration with Efficy and Exact. One of the flows i need to implement is uploading invoices from exact to Efficy as an attachment. I currently put it in a workflow function and it works fine. However, this flow is very slow (multiple calls to exact so can't make it faster)  and is blocking the end user from doing anything for 20-30 seconds. Is there a way without using schedulers to execute this flow in an async way? A bit like queueing that the  function should be executed in the background. &lt;br&gt;
Or is the only solution using a scheduler service and just use a small time interval? &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7205/how-to-queue-function-call-in-workflow-script-execute-async</guid>
<pubDate>Wed, 12 Nov 2025 08:29:40 +0000</pubDate>
</item>
<item>
<title>Syntax for function OnAddLinkOppoPubl(Key, DetailKey)</title>
<link>https://overflow.efficy.io/?qa=7172/syntax-for-function-onaddlinkoppopubl-key-detailkey</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
What is the syntax using the function OnAddLinkOppoPubl(Key, DetailKey) ?&lt;br&gt;
I just want to update the STATUS field of the opportunity after adding a link from the publication to the opportunity.&lt;br&gt;
Thank you&lt;br&gt;
Dimitri&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7172/syntax-for-function-onaddlinkoppopubl-key-detailkey</guid>
<pubDate>Tue, 22 Apr 2025 10:17:09 +0000</pubDate>
</item>
<item>
<title>How to emplement runscript for email template</title>
<link>https://overflow.efficy.io/?qa=7162/how-to-emplement-runscript-for-email-template</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm used to create runscripts to personnalize docx files, but it seems to be different with email templates.&lt;/p&gt;

&lt;p&gt;This runscript &lt;code&gt;[$RunScript(module=&quot;templates/email&quot;, name=&quot;iu_nom_prenom&quot;)]&lt;/code&gt; works fine in a docx template, but I have no result in an email template.&lt;/p&gt;

&lt;p&gt;While debugging, I fugured out that the contKey = 0 while editing the email template but I got the good value with a docx version :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var contKey = Efficy.getMainDetail(editHandle, ntCont);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Do you have any tips/informations ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7162/how-to-emplement-runscript-for-email-template</guid>
<pubDate>Mon, 17 Feb 2025 15:55:01 +0000</pubDate>
</item>
<item>
<title>Is there any AfterLoad Trigger or Hook? (Efficy (Build 12.1.28052.0 2024-10-11 15:00))</title>
<link>https://overflow.efficy.io/?qa=7159/is-there-any-afterload-trigger-hook-efficy-build-28052-2024</link>
<description>&lt;p&gt;Our goal is to encrypt and decrypt different columns with different keys. The encryption and decryption must take place on a different server! This server provides a REST API that should be accessed from within efficy.&lt;/p&gt;

&lt;p&gt;When a record is saved, I can easily implement this using the BeforeCommit Trigger. However, it seems to be more difficult to load records. As far as I know, there is no AfterLoad Trigger. I haven't found a hook for reading records either. &lt;/p&gt;

&lt;p&gt;Does anyone have any idea? Where would be the best place to start?&lt;/p&gt;

&lt;p&gt;Best&lt;br&gt;
Stefan&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7159/is-there-any-afterload-trigger-hook-efficy-build-28052-2024</guid>
<pubDate>Fri, 31 Jan 2025 18:29:27 +0000</pubDate>
</item>
<item>
<title>Efficy.setUserSecurity: You can't assign a security level you don't have as default right !</title>
<link>https://overflow.efficy.io/?qa=7115/efficy-setusersecurity-assign-security-level-default-right</link>
<description>&lt;p&gt;I have an record on a custom entity which have the following security&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=8288596365479332405&quot; alt=&quot;Record security&quot;&gt;&lt;/p&gt;

&lt;p&gt;From a BeforeCommit workflow trigger for this entity, I am using the following code&lt;/p&gt;

&lt;p&gt;var secuKUser = 99999002; &lt;br&gt;
Efficy.setUserSecurity(editHandle, 99999002, 271); // 99999002 = EFF_ADMINS and 271 = FullControl.&lt;/p&gt;

&lt;p&gt;But then I get the following error, and I don't know what is wrong, does anyone have an idea?&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=14561439693553584861&quot; alt=&quot;error message&quot;&gt;&lt;/p&gt;

&lt;p&gt;PS : My efficy version is &lt;strong&gt;Efficy Entreprise 2021 - Build 12.0.27691.0&lt;/strong&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7115/efficy-setusersecurity-assign-security-level-default-right</guid>
<pubDate>Thu, 26 Sep 2024 14:17:03 +0000</pubDate>
</item>
<item>
<title>How not to link product abd subproducts in an opportunity with fragments</title>
<link>https://overflow.efficy.io/?qa=6997/how-not-link-product-subproducts-opportunity-with-fragments</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;When using fragments, if you insert a product in an opportunity, if the selected product has subproducts, all the products are liked in the opportunity.&lt;br&gt;
Pnce all the products are liked to the opportunity, if you modify the quantity, the quantities of all the products are modified.&lt;br&gt;
If you want to delete the main product, all the subproducts are deleted.&lt;br&gt;
The reason is that in the database, ech subproduct has his own K_PARENT field filled.&lt;br&gt;
&lt;strong&gt;Is it possible just to insert the selected product and not all the subproducts ?&lt;/strong&gt;&lt;br&gt;
Thank you&lt;br&gt;
Dimitri&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6997/how-not-link-product-subproducts-opportunity-with-fragments</guid>
<pubDate>Sun, 26 Nov 2023 18:59:14 +0000</pubDate>
</item>
<item>
<title>Generate stats in Excel format</title>
<link>https://overflow.efficy.io/?qa=6973/generate-stats-in-excel-format</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I want to generate some stats (server side) and I want to have an excel format (no csv)&lt;/p&gt;

&lt;p&gt;I know I can use strSaveTextFile to generate file, but how could I generate excel ? &lt;/p&gt;

&lt;p&gt;thanks in advance :) &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6973/generate-stats-in-excel-format</guid>
<pubDate>Tue, 19 Sep 2023 07:14:33 +0000</pubDate>
</item>
<item>
<title>Created new Entity, but Swedisch translation is not working</title>
<link>https://overflow.efficy.io/?qa=6962/created-new-entity-but-swedisch-translation-is-not-working</link>
<description>&lt;p&gt;Efficy login in with Swedisch language.&lt;/p&gt;

&lt;p&gt;When I login to: &lt;a rel=&quot;nofollow&quot; href=&quot;https://xxxxxxx.efficytest.cloud&quot;&gt;https://xxxxxxx.efficytest.cloud&lt;/a&gt; i get: &quot;VISITS&quot; as label = NOT OK&lt;br&gt;
When I login localy &lt;a rel=&quot;nofollow&quot; href=&quot;http://efficy120/crm:&quot;&gt;http://efficy120/crm:&lt;/a&gt; I get &quot;BESÖK&quot; as label = OK&lt;/p&gt;

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

&lt;pre&gt;&lt;code&gt;==&amp;gt; Languages:ENDENLFRSV
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;VISITVisitBesuchBezoekVisiterBesök&lt;br&gt;
VISITSVisitsBesucheBezoeken2VisitesBesök&lt;br&gt;
VisiVisitBesuchBezoekVisiterBesöken&lt;br&gt;
VisisVisitsBesucheBezoekenVisitesBesök&lt;/p&gt;

&lt;p&gt;I investigated this together with my TA and we cannot figure out what we ar doing wrong. The tabulation should be fine&lt;/p&gt;

&lt;p&gt;Can someone help me please?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6962/created-new-entity-but-swedisch-translation-is-not-working</guid>
<pubDate>Thu, 07 Sep 2023 15:25:14 +0000</pubDate>
</item>
<item>
<title>how can I create an extranet  password link with few days duration option</title>
<link>https://overflow.efficy.io/?qa=6945/how-create-extranet-password-link-with-days-duration-option</link>
<description>&lt;p&gt;hello&lt;br&gt;
I have to generate some documents that I need to share with some news contacts with no extranet access.&lt;br&gt;
So In a publication I have a button with a script to generate lot of documents. In this publication all the contacts will receive an email with their each custom access on the extranet + the link when acc_auth is empty with the generated url from : Efficy.generateExtranetPasswordURL&lt;/p&gt;

&lt;p&gt;Problem this url has a short time of validity. My contacts may will be connected only few days after.&lt;/p&gt;

&lt;p&gt;Is there a way to change availability duration of this generated url ?  &lt;/p&gt;

&lt;p&gt;thank for your backup &lt;br&gt;
laurent&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6945/how-create-extranet-password-link-with-days-duration-option</guid>
<pubDate>Tue, 01 Aug 2023 16:34:03 +0000</pubDate>
</item>
<item>
<title>actionlauncher: open Oppo Edit</title>
<link>https://overflow.efficy.io/?qa=6930/actionlauncher-open-oppo-edit</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;We have implemented this code: &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/actionLauncher&quot;&gt;https://help.efficy.io/edn/projectguides/actionLauncher&lt;/a&gt;&lt;br&gt;
When closing an action with an oppo linked, we want to open the oppo in edit mode.&lt;/p&gt;

&lt;p&gt;This works when we click on Save but not when we click on Apply. When we click on Apply the action windows is still open.&lt;/p&gt;

&lt;p&gt;How can we get this also working when clicking on action.Apply&lt;/p&gt;

&lt;p&gt;gr&lt;br&gt;
Erwin&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6930/actionlauncher-open-oppo-edit</guid>
<pubDate>Thu, 15 Jun 2023 13:05:58 +0000</pubDate>
</item>
<item>
<title>Why can't I bypass the read-only dataset with Efficy.disableSecurity</title>
<link>https://overflow.efficy.io/?qa=6911/cant-bypass-read-only-dataset-with-efficy-disablesecurity</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I want to bypass a security (a customer who haven't the rigth to modify an entity) so I wrote this code : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;SetContactRobinson: function(kCont, blacklisted) {
        if (!kCont) return;
        var editContext = Efficy.openEditContext(ntCont, kCont);

        //on désactive les sécurités pour permettre la modifications des contacts
        var disableSecurityOld = Efficy.disableSecurity;
        Efficy.disableSecurity = true;

        try {
            Efficy.updateField(editContext, 0, 'ROBINSON', (blacklisted ? &quot;1&quot; : &quot;0&quot;));
            Efficy.commitChanges(editContext, false);
        }
        finally {
            Efficy.closeContext(editContext);
            Efficy.disableSecurity = disableSecurityOld;
        }
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But I have this error : &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;!! ERROR: DS&lt;em&gt;ContEdit&lt;/em&gt;0_Cont: Cannot modify a read-only dataset&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I guess the data set is read only cause my user haven't right to modify this contact, but why &lt;code&gt;Efficy.disableSecurity = true;&lt;/code&gt; dosen't work here ? &lt;/p&gt;

&lt;p&gt;thanks in advance&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6911/cant-bypass-read-only-dataset-with-efficy-disablesecurity</guid>
<pubDate>Thu, 01 Jun 2023 08:49:33 +0000</pubDate>
</item>
<item>
<title>Cannot access certain field of Product in template</title>
<link>https://overflow.efficy.io/?qa=6879/cannot-access-certain-field-of-product-in-template</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I want to generate an Instant Document (using a docx template) of a contact, showing all products of that contact. I am able to show the &lt;code&gt;NAME&lt;/code&gt; field of each product, but not &lt;code&gt;R_FAMILY&lt;/code&gt;. For the latter, I get the following error:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Error while executing script &quot;CreateInstantDoc&quot; at line 820 char 3. (File &quot;efficy\serverscripts\Create.js&quot; line 231)
Message: &quot;DS_DocuEdit_6_Docu_Prod: Field 'R_FAMILY' not found (word\document.xml)&quot;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To link the products of the contact to the document, I added the following code to the &lt;code&gt;CreateInstantDoc&lt;/code&gt; function in &lt;code&gt;Create.js&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var Cont = Efficy.getMainDetail(DocuContext, ntCont);
if (Cont != 0) {
    Efficy.copyDetails2(DocuContext, ntCont, Cont, [ntComp, ntProj, ntProd], false, false);
    var ContContext = Efficy.openConsultContext(ntCont);
    var QueryHandle = 0;
    var ProdDataSet = Efficy.consultDetail(QueryHandle, ContContext, Cont, ntProd, true, true, 0);
    ProdDataSet.First;
    while (! ProdDataSet.Eof) {
        var K_Product = ProdDataSet.FieldByName('K_PRODUCT').AsFloat;
        Efficy.insertDetail2(DocuContext, ntProd, K_Product, false);
        ProdDataSet.Next;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In the docx template, I use the following:&lt;br&gt;
&lt;code&gt;[$GetTable('PROD')] &amp;lt;#repeat&amp;gt;&amp;lt;#F=R_FAMILY&amp;gt;&amp;lt;/#repeat&amp;gt;
 [/$]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Could you help me with this?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6879/cannot-access-certain-field-of-product-in-template</guid>
<pubDate>Fri, 14 Apr 2023 10:32:38 +0000</pubDate>
</item>
<item>
<title>Do we have a workflow trigger for workStages?</title>
<link>https://overflow.efficy.io/?qa=6828/do-we-have-a-workflow-trigger-for-workstages</link>
<description>&lt;p&gt;Hello,&lt;br&gt;
Do we have a workflow trigger for workStages?&lt;br&gt;
for example some thing like &lt;code&gt;AfterCommitXXXX&lt;/code&gt;&lt;br&gt;
Thanks&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6828/do-we-have-a-workflow-trigger-for-workstages</guid>
<pubDate>Mon, 27 Feb 2023 17:23:53 +0000</pubDate>
</item>
<item>
<title>Merging 2 projects how to keep all the Stages/Deliverables and Steps of both projets on the kept projet?</title>
<link>https://overflow.efficy.io/?qa=6793/merging-projects-stages-deliverables-steps-projets-projet</link>
<description>&lt;p&gt;We remarked that when we merge 2 projets from the search window, the Stages/Deliverables and Steps of the projet that is not kept (deleted project) are also deleted and they are not relink to the kept projet.&lt;/p&gt;

&lt;p&gt;Is there an easy way to enable to keep all the Stages/Deliverables and Steps from both projects on the merged project ? &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6793/merging-projects-stages-deliverables-steps-projets-projet</guid>
<pubDate>Thu, 12 Jan 2023 17:15:15 +0000</pubDate>
</item>
<item>
<title>How to delete all detail attachements/files contains in an Efficy Document where some of the files have revision?</title>
<link>https://overflow.efficy.io/?qa=6789/delete-detail-attachements-contains-efficy-document-revision</link>
<description>&lt;p&gt;Does anyone knows how to delete all files in a document with ServerJS when some of the files have revision ?&lt;/p&gt;

&lt;p&gt;I tried the following code, but then I have an endless loop since several files have the same key but a different revision number !&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;dsFile = Efficy.getDetailDataSet(docuContext, ntFile);
dsFile.first();
while (!dsFile.eof) {
Efficy.deleteDetail(docuContext, ntFile, dsFile.fieldByName('K_FILE').asFloat);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;PS : I remarked that the same code has been used in Efficy 2021 for the invoicing module (cf function deleteDetails in serverjs\invoicing\invoicing.js) ... So the issue I encountered may also be a standard issue&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6789/delete-detail-attachements-contains-efficy-document-revision</guid>
<pubDate>Fri, 06 Jan 2023 09:34:39 +0000</pubDate>
</item>
<item>
<title>How do I know if an email is blocked in SYS_MAILS because of an incorrect address?</title>
<link>https://overflow.efficy.io/?qa=6773/how-know-email-blocked-sysmails-because-incorrect-address</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;How do I ensure that the sending of emails stored in SYS_MAILS continues to be sent when an email address in the batch is incorrect?&lt;/p&gt;

&lt;p&gt;In previous versions, all emails left, even if an address was wrong.&lt;/p&gt;

&lt;p&gt;In the logs, we see that Efficy has detected that an address is wrong but noboby is informed and the mailings are blocked.&lt;/p&gt;

&lt;p&gt;What is the solution?&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Dimitri&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6773/how-know-email-blocked-sysmails-because-incorrect-address</guid>
<pubDate>Mon, 05 Dec 2022 16:48:21 +0000</pubDate>
</item>
<item>
<title>how to use an UTF8-BOM file with SmartDecompressEx(myStream);</title>
<link>https://overflow.efficy.io/?qa=6743/how-to-use-an-utf8-bom-file-with-smartdecompressex-mystream</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm using the SmartDecompressEx() to read csv file within a processrunner.&lt;br&gt;
My problem is that accented characters are not decoded.&lt;/p&gt;

&lt;p&gt;My file is a csv ; separated file.&lt;br&gt;
What i've try is to encode my file in :&lt;br&gt;
- UTF8. (&lt;strong&gt;OK&lt;/strong&gt; in NotePad++, &lt;strong&gt;NOK&lt;/strong&gt; in Excell, &lt;strong&gt;NOK&lt;/strong&gt; in Efficy with SmartDecompressEx())&lt;br&gt;
- UTF8-BOM. (&lt;strong&gt;OK&lt;/strong&gt; in NotePad++, &lt;strong&gt;OK&lt;/strong&gt; in Excell, &lt;strong&gt;NOK&lt;/strong&gt; in Efficy with SmartDecompressEx())&lt;/p&gt;

&lt;p&gt;I also tryed the smartDecompressToFile() with my UTF8-BOM file, and then use the strLoadTextFile(), the result of this is &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It seems like the SmartDecompressEx() doesn't take into account the UTF8-BOM format.&lt;/p&gt;

&lt;p&gt;Have you any idea of what i could do ?&lt;br&gt;
I'm using this with the processRunner on an Efficy 11.3&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6743/how-to-use-an-utf8-bom-file-with-smartdecompressex-mystream</guid>
<pubDate>Mon, 07 Nov 2022 09:59:31 +0000</pubDate>
</item>
<item>
<title>set a dataset field to null</title>
<link>https://overflow.efficy.io/?qa=6735/set-a-dataset-field-to-null</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
I want to set a field to null but when I try this : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;DataSet.fieldByName('F_FIELD').AsString = null;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I get this message.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Message: Could not convert variant of type (Null) into type (OleStr)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;hence my question, how could I set null to a dataset ? By why should I replace &quot;asString&quot; ? &lt;/p&gt;

&lt;p&gt;Thanks in advance ;) &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6735/set-a-dataset-field-to-null</guid>
<pubDate>Tue, 25 Oct 2022 08:27:29 +0000</pubDate>
</item>
<item>
<title>Encoding issue using OpenUrlSecure</title>
<link>https://overflow.efficy.io/?qa=6721/encoding-issue-using-openurlsecure</link>
<description>&lt;p&gt;Hello Everyone,&lt;/p&gt;

&lt;p&gt;I'm using an OpenUrlSecure to send a json content to an external application.&lt;br&gt;
When the body of my request contain some accented character like é, è, à  it make some bad character in the external application.&lt;/p&gt;

&lt;p&gt;I think about an encoding problem&lt;br&gt;
I've test the request with charset=UTF-8 in the headers, but the result is the same&lt;/p&gt;

&lt;p&gt;I've try to call directly my external application with postman, using the same body, the same header, and there the result is OK, so the issue is not in the external application.&lt;/p&gt;

&lt;p&gt;I'm in an 11.2, so i can't use the new OpenUrlSecureUtf8 fonction.&lt;/p&gt;

&lt;p&gt;Have you any idea ?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6721/encoding-issue-using-openurlsecure</guid>
<pubDate>Thu, 13 Oct 2022 10:35:25 +0000</pubDate>
</item>
<item>
<title>How translate message / label into a standard serverJS like spyCases.js</title>
<link>https://overflow.efficy.io/?qa=6604/translate-message-label-into-standard-serverjs-like-spycases</link>
<description>&lt;p&gt;We need to customize the Spycase file with lot of translations  into the declared var MAILS.&lt;/p&gt;

&lt;p&gt;Depending on USER language preferences we want to translate in some language all the value.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var MAILS = {
Close  : &quot;The case has been closed by the SpyCase.&quot;,
Remind : &quot;The Customer/Partner has not replied in $0 days.\nPlease send a reminder or tentatively close the case.&quot;,
Revive : &quot;This case has not changed in $0 days.\nThe ticket was waiting for $1.\nPlease take action to activate this case.&quot;,
Links  : &quot;\n___________________________________\nThis case is linked to $0$1$2&quot;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;So we basically searched into the standard to find all those labels into the EfficyLabels txt file and adding our own definitions. But without any success.&lt;br&gt;
So we try to compare with native serverJS where some labels are translated.&lt;br&gt;
So we found some translation into few serverJS like invoicing/invoicing.js with &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (!mainLinkedEntityId) throw new Error(format(Utils.translate('The main linked $0 could not be retrieved'), linkedEntity)); 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;or into workload/roadmapElement.js&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (!this.hasRight(right, projKey, nodeType, nodeKey, fields)) {
throw new Error(
format(
Request.translate('You need the $0 right on the $1 #$2 to perform this action'),
right,
Efficy.entityCatalog.getEntityName(ntTable),
nodeKey
)
);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We tried to add needed modules to run a translation but nothing worked.&lt;br&gt;
So anybody has already translated this kind of labels into a serverJS used into the Scheduled Efficy Service ?&lt;/p&gt;

&lt;p&gt;Thank's&lt;br&gt;
Laurent Tuffraud &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6604/translate-message-label-into-standard-serverjs-like-spycases</guid>
<pubDate>Thu, 16 Jun 2022 09:23:06 +0000</pubDate>
</item>
<item>
<title>Opportunity : set Linked Prod read only</title>
<link>https://overflow.efficy.io/?qa=6599/opportunity-set-linked-prod-read-only</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I have a need for a customer who wants to trigger some security changes if the status of an Oppo changes.&lt;br&gt;
There is already a workflow (BeforeCommitOppo) based on this field that set the Oppo read only except for Administrators.&lt;/p&gt;

&lt;p&gt;Now my customer wants to also set all Linked Products read only but just the Prod_Oppo relation, not the Product element. Knowing that they use the old system for Linked Prod, due to some custom, you can't add Product in the Oppo window, you have to use the Linked prod tab on the consult window of the Oppo.&lt;/p&gt;

&lt;p&gt;Is there an easy way to do that ? I saw the function applySecurityToContent but I am not sure it works as I want.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6599/opportunity-set-linked-prod-read-only</guid>
<pubDate>Wed, 15 Jun 2022 07:22:24 +0000</pubDate>
</item>
<item>
<title>How to create a directory on the Efficy Server by workflow ?</title>
<link>https://overflow.efficy.io/?qa=6596/how-to-create-a-directory-on-the-efficy-server-by-workflow</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;Actually, I can create a batch file launched by a Windows service each minute.&lt;br&gt;
The content of this batch file is modified by workflow.&lt;br&gt;
I would like to create this directory from the workflow without using the bacth file because I must be sure that the directory has been created before saving pdf files in it.&lt;br&gt;
With the previous solution I must use a timeout before saving the files in the directory.&lt;br&gt;
Any solution ?&lt;br&gt;
Dimitri&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6596/how-to-create-a-directory-on-the-efficy-server-by-workflow</guid>
<pubDate>Tue, 14 Jun 2022 13:27:30 +0000</pubDate>
</item>
<item>
<title>How to convert windows 1252 to UTF-8 ?</title>
<link>https://overflow.efficy.io/?qa=6592/how-to-convert-windows-1252-to-utf-8</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm running into an issue regarding char encoding.&lt;/p&gt;

&lt;p&gt;I'm making a Efficy.openUrlSecure(...) POST call to send JSON data to another system.&lt;br&gt;
Data is from a Contact (name, firstname, email, ....) and my call is made in a afterCommit workflow. So all data is taken from database.&lt;/p&gt;

&lt;p&gt;If I use a special char like &quot;é&quot; in sent data, the API send me an error :&lt;br&gt;
&lt;em&gt;Error 400. Response : Invalid UTF-8 middle byte 0x22 at...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Code used :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var toSend = JSON.stringify(data);
var headers = [&quot;Content-Type: application/json;charset=utf-8&quot;, &quot;Content-Length: &quot; + toSend.length, &quot;Host: xxx&quot;];

var response = Efficy.openUrlSecure(url, toSend, headers.join(&quot;\n&quot;), &quot;POST&quot;);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After investigation, this error is caused by an invalid/illegal encoding (windows 1252 instead of UTF-8 which is standard for JSON).&lt;/p&gt;

&lt;p&gt;When I check in detail what is sent, the request payload is in windows-1252.&lt;/p&gt;

&lt;p&gt;Which brings it to my question : How can I convert my data in windows-1252 to UTF-8 without losing accentuated char ?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6592/how-to-convert-windows-1252-to-utf-8</guid>
<pubDate>Fri, 10 Jun 2022 09:44:52 +0000</pubDate>
</item>
<item>
<title>How to read file from form (POST)</title>
<link>https://overflow.efficy.io/?qa=6527/how-to-read-file-from-form-post</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;I'm trying to read a file send from the client. But I feel like I can't easily read data sent with POST action.&lt;/p&gt;

&lt;p&gt;Here is my html : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;%GetLabel('Result Validation')%&amp;gt;&amp;lt;/title&amp;gt;
    &amp;lt;script&amp;gt;
        function test() {
            console.log(&quot;test !&quot;);
            var form = document.forms[0];
            form.submit();
        }
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form method=&quot;POST&quot; action=&quot;dialog?page=ScriptRun&amp;amp;ScriptFile=serverscripts/test.js&amp;amp;ScriptName=myTest&amp;amp;myArg=Read form with file (POST)&quot; enctype=&quot;multipart/form-data&quot;&amp;gt;
    &amp;lt;button type=&quot;button&quot; class=&quot;action tiny&quot; onclick=&quot;test()&quot;&amp;gt;test&amp;lt;/button&amp;gt;
    &amp;lt;input type=&quot;file&quot; name=&quot;fileToUpload&quot; id=&quot;fileToUpload&quot;&amp;gt;
    &amp;lt;input type=&quot;text&quot; id=&quot;textTest&quot; name=&quot;myTextTest&quot;&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Here the function called via ScriptRun&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function myTest()
{
    var value = &quot;\ntest : &quot; + Request.argument('myArg') + &quot;\n&quot;;

    value += &quot;rawContent : &quot; + Request.rawContent + &quot;\n&quot;;

    value += &quot;myTextTest : &quot; + Request.argument(&quot;myTextTest&quot;) + &quot;\n&quot;;
    value += &quot;myTextTest2 : &quot; + Request.contentField(&quot;myTextTest&quot;) + &quot;\n&quot;;

    strSaveTextFile(&quot;C:\\EfficyWebServer\\myTest.txt&quot;, value, false);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I can easily get the &quot;myArg&quot; argument from the URL (&quot;dialog?page=ScriptRun&amp;amp;ScriptFile=serverscripts/test.js&amp;amp;ScriptName=myTest&amp;amp;&lt;strong&gt;myArg=Read form with file (POST)&lt;/strong&gt;&quot; ) with  Request.argument('myArg') cause myArg is send with GET action.&lt;/p&gt;

&lt;p&gt;But I can't get the value of myTextTest field...&lt;/p&gt;

&lt;p&gt;Neither Request.argument(&quot;myTextTest&quot;)  nor Request.contentField(&quot;myTextTest&quot;) works.&lt;br&gt;
I wonder too how can I read the file send with POST action ? &lt;/p&gt;

&lt;p&gt;the output of my myTest function is : &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;test : Read form with file (POST) rawContent :&lt;br&gt;
  ------WebKitFormBoundaryWo2If3HyQ8bFKfUg Content-Disposition: form-data; name=&quot;fileToUpload&quot;; filename=&quot;test.csv&quot; Content-Type:&lt;br&gt;
  text/csv&lt;/p&gt;
  
  &lt;p&gt;test;test1;test2;test3 val;val1;val2;val3&lt;br&gt;
  ------WebKitFormBoundaryWo2If3HyQ8bFKfUg Content-Disposition: form-data; name=&quot;myTextTest&quot;&lt;/p&gt;
  
  &lt;p&gt;myValue&lt;br&gt;
  ------WebKitFormBoundaryWo2If3HyQ8bFKfUg--&lt;/p&gt;
  
  &lt;p&gt;myTextTest :  myTextTest2 :&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We can see that my &quot;myTextTest&quot; field is present and my file too. I could use a regex to handle this but I'm hoping there's a &quot;cleaner&quot; method&lt;/p&gt;

&lt;p&gt;Thanks in advances for your help :) &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6527/how-to-read-file-from-form-post</guid>
<pubDate>Mon, 09 May 2022 09:54:27 +0000</pubDate>
</item>
<item>
<title>Efficy 12.0 user securities list is missing options</title>
<link>https://overflow.efficy.io/?qa=6357/efficy-12-0-user-securities-list-is-missing-options</link>
<description>&lt;p&gt;I remarked that in Efficy 2021 the list of securities options is different from Efficy 11.3 version when linking a user in the securities. Is there any reason for this change ? &lt;/p&gt;

&lt;p&gt;PS : this can raise errors while migrating customers from previous version to Efficy 2021, so developper will need to review all serverscripts/serverJS where the function &quot;Efficy.setUserSecurity&quot; is used&lt;/p&gt;

&lt;p&gt;Efficy 2021 security list option for user&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=16992724239585024457&quot; alt=&quot;Efficy 2021 security list option for user&quot;&gt;&lt;/p&gt;

&lt;p&gt;Efficy 11.3 security list option for user&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=15338258538145982642&quot; alt=&quot;Efficy 11.3 security list option for user&quot;&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6357/efficy-12-0-user-securities-list-is-missing-options</guid>
<pubDate>Wed, 17 Nov 2021 11:36:39 +0000</pubDate>
</item>
<item>
<title>How to reset user (using SetUsers true) except resources.</title>
<link>https://overflow.efficy.io/?qa=6356/how-to-reset-user-using-setusers-true-except-resources</link>
<description>&lt;p&gt;I want to reset users into the workflow but I need to keep all users like resources.&lt;br&gt;
Is there a quick way to do that with an Efficy function ?&lt;/p&gt;

&lt;p&gt;My only alternative way is to check user before reset, identify the ressources and add them into my varArrayOf users I want to set.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6356/how-to-reset-user-using-setusers-true-except-resources</guid>
<pubDate>Tue, 16 Nov 2021 13:02:32 +0000</pubDate>
</item>
<item>
<title>Error: &quot;data corrupted&quot; when upload images from DataSynchro Remote</title>
<link>https://overflow.efficy.io/?qa=6329/error-data-corrupted-when-upload-images-datasynchro-remote</link>
<description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;I'm uploading a file attached to a document from DataSynchro Remote, I get to create the Document and upload an image attached to it but when I try to download or preview the image from Efficy I get an error saying &quot;&lt;strong&gt;Error while decompressing stream ZLib error message: Data may be corrupted&lt;/strong&gt;&quot;.&lt;/p&gt;

&lt;p&gt;The code inserting the attachment and create the Document is this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Efficy.insertAttachment(editHandle, 1, filePath);
                Efficy.updateFields2(editHandle, 0, [&quot;NAME&quot;], [removeInvalidFileChars(fileName)]);

                Efficy.commitChanges(editHandle, true);
                Efficy.executeBatch;

                Efficy.updateDetail2(editHandle, ntFile, 0, &quot;STREAM&quot;, fileStream);
                Efficy.updateDetail2(editHandle, ntFile, 0, &quot;FILESIZE&quot;, fileStream.length);
                Efficy.updateDetail2(editHandle, ntFile, 0, &quot;PATH&quot;, removeInvalidFileChars(fileName));
                Efficy.updateDetail2(editHandle, ntFile, 0, &quot;COMMENT&quot;, removeInvalidFileChars(fileName));

                Efficy.commitChanges(editHandle, true);
                Efficy.executeBatch;
                kDocument = Efficy.getEditKey(editHandle);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And I'm reading getting the image like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (FileExists(file))
        return strLoadBinaryFile(file);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On execution I don't receive any error, checking the FILES table on the DB I noticed the file indeed has data on the STREAM column. I've tried uploading the same image and creating the Document directly in Efficy and everything works fine, I can download and see the image with no issue.&lt;/p&gt;

&lt;p&gt;Thanks for the help.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6329/error-data-corrupted-when-upload-images-datasynchro-remote</guid>
<pubDate>Wed, 20 Oct 2021 11:52:49 +0000</pubDate>
</item>
<item>
<title>Efficy.currentUserCode() is returning email address</title>
<link>https://overflow.efficy.io/?qa=6269/efficy-currentusercode-is-returning-email-address</link>
<description>&lt;p&gt;Customer reports:&lt;br&gt;
Efficy.currentUserCode() is returning email address&lt;/p&gt;

&lt;p&gt;When renaming a document name by workflow script a usercode is wanted as part of the documents name. &lt;br&gt;
But the email address of the current user is returned.&lt;/p&gt;

&lt;p&gt;By the way, I can not reproduce this issue. Debugging does not provide any answers.&lt;br&gt;
The problem occurred after upgrading to Efficy 12.0&lt;/p&gt;

&lt;p&gt;Anyone a clue?&lt;br&gt;
Efficy (Build 12.0.25231.0 2021-06-25 10:33)&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6269/efficy-currentusercode-is-returning-email-address</guid>
<pubDate>Wed, 01 Sep 2021 09:39:39 +0000</pubDate>
</item>
<item>
<title>format settings difference between efficy and scheduleur</title>
<link>https://overflow.efficy.io/?qa=6262/format-settings-difference-between-efficy-and-scheduleur</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;i'm in Efficy 11.2&lt;br&gt;
I have a custom module using this code &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var strDate = formatDateTime(&quot;yyyy/mm/dd hh:nn:ss&quot;, dateItemNomenclature)
dateItemNomenclature = standardStrToDateTime(strDate);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;according the edn, &lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&quot;/&quot; : Displays the date separator character given by the&lt;br&gt;
  DateSeparator global variable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;so i suppose formatDateTime is using the one configured in the base.js DateSeparator variable (for efficy 11.2)&lt;/p&gt;

&lt;p&gt;My problem is that when this code is called by efficy scheduler, it seems that formatDateTime() is using the separator from windows regional settings who in my case is different (- in place of /)&lt;/p&gt;

&lt;p&gt;My &quot;second&quot; problem is that in both cases (Efficy Web and Efficy Scheduler) the function standardStrToDateTime() is using the &quot;/&quot; separator (i didn't know from where he get his config)&lt;/p&gt;

&lt;p&gt;The resume is that i have two function, one using a different separator when called from efficy or from scheduler,  and the second using the same separator watherver it is called from efficy or from scheduler.&lt;/p&gt;

&lt;p&gt;So, i will try to see if we can change the regional settings of the server to bypass the problem, but i have some questions.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is it different with newer version of Efficy ?&lt;/li&gt;
&lt;li&gt;Can we force scheduleur to use another dateseparator settings?&lt;/li&gt;
&lt;li&gt;From where the function standardStrToDateTime() is getting his settings ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regards,&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6262/format-settings-difference-between-efficy-and-scheduleur</guid>
<pubDate>Thu, 26 Aug 2021 08:18:36 +0000</pubDate>
</item>
<item>
<title>Error in FieldByName</title>
<link>https://overflow.efficy.io/?qa=6254/error-in-fieldbyname</link>
<description>&lt;p&gt;I get the following error DS&lt;em&gt;CompConsult&lt;/em&gt;0_Comp: Field 'EMAIL1' not found with the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;   var K_COMPANY = Efficy.GetMainDetail(EditHandle, ntComp)
   var compHandle = Database.OpenConsultContext(ntComp, K_COMPANY)
   if(compHandle &amp;gt; 0){
    var compDS = Database.getMasterDataSet(compHandle,0)
        var mail = compDS.FieldByName(&quot;EMAIL1&quot;).AsString
  }
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6254/error-in-fieldbyname</guid>
<pubDate>Tue, 17 Aug 2021 10:00:10 +0000</pubDate>
</item>
<item>
<title>Call EditInitializedPackProd on edit and on add</title>
<link>https://overflow.efficy.io/?qa=6205/call-editinitializedpackprod-on-edit-and-on-add</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;When you edit an existing pack_prod relation by pressing 'Edit relation' on a product in a package, the function EditInitializedPackProd is called. When a new product is added and a product is selected that already has a relation with the package, the same EditInitializedPackProd function is called.&lt;/p&gt;

&lt;p&gt;Is there a way to know if the function is called from the editRelation button or via the addProduct button?&lt;/p&gt;

&lt;p&gt;Right now, the function has 2 parameters EditHandle and Inserted. Inserted returns false in both cases, so this is not the solution I was hoping for.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6205/call-editinitializedpackprod-on-edit-and-on-add</guid>
<pubDate>Tue, 29 Jun 2021 12:55:22 +0000</pubDate>
</item>
<item>
<title>AfterLoaded add pack to docu</title>
<link>https://overflow.efficy.io/?qa=6196/afterloaded-add-pack-to-docu</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I'm trying to do some custom coding when a user adds a package to a document. I'm trying to edit the AfterLoaded function in docuEdit.js.&lt;/p&gt;

&lt;p&gt;When I call the following code, a list of all packs linked to the document is returned, but the onclick function only works when the pack is selected as main. The second problem with this code is that the list is returned with every change on the document.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var packlink = document.getElementsByName(&quot;Pack-MAIN&quot;);
    console.log(packlink);
    if(packlink) {
        for (var i = 0 ; i &amp;lt; packlink.length ; ++i) {
            packlink[i].onclick = OnPackLinkChanged
        }
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Is there a way for me to know which package is added to the document and only execute the custom code for the package that is added?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6196/afterloaded-add-pack-to-docu</guid>
<pubDate>Wed, 23 Jun 2021 08:11:47 +0000</pubDate>
</item>
<item>
<title>Error : (ZEOS-2174) External exception C000001D</title>
<link>https://overflow.efficy.io/?qa=6190/error-zeos-2174-external-exception-c000001d</link>
<description>&lt;p&gt;At a customer we received the following error code, but we don't don't what it means. Does anyone know about this error  ?&lt;/p&gt;

&lt;p&gt;Error while executing script &quot;AfterCommitMiss&quot; at line 1464 char 5. (File &quot;customs\xxxx\shared\serverjs\workflow\mainWorkflow.js&quot; line 1044)&lt;/p&gt;

&lt;p&gt;Message: &quot;&lt;strong&gt;External exception C000001D&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;select MISS_CONT.*, CONTACTS.NAME, CONTACTS.FIRSTNAME, CONTACTS.MIDDLENAME, CONTACTS.OPENED, CONTACTS.F_PROFIL, (select F_LABEL from admindemosthene.LK_CONT_PROFIL L1081 where L1081.K_CONT_PROFIL=CONTACTS.F_PROFIL) as R_F_PROFIL, (select F_LABEL from admindemosthene.LK_CONT_FACTURE L1153 where L1153.K_CONT_FACTURE=MISS_CONT.F_FACTURE) as R_F_FACTURE, (select NAME from admindemosthene.COMPANIES L1154 where L1154.K_COMPANY=MISS_CONT.F_PARTENAIRE) as R_F_PARTENAIRE, (select F_LABEL from admindemosthene.LK_CONT_TYPE_CONTRAT L1157 where L1157.K_CONT_TYPE_CONTRAT=MISS_CONT.F_TYPE_CONTRAT) as R_F_TYPE_CONTRAT from admindemosthene.MISS_CONT MISS_CONT join admindemosthene.CONTACTS CONTACTS on MISS_CONT.K_CONTACT = CONTACTS.K_CONTACT where (MISS_CONT.K_MISSION = :MISS_CONT_K_MISSION) order by MISS_CONT.MAIN DESC, CONTACTS.NAME&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;ErrorContext&lt;/h2&gt;

&lt;p&gt;EEfficyException 0&lt;br&gt;
&lt;strong&gt;(ZEOS-2174) External exception C000001D&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;select MISS_CONT.*, CONTACTS.NAME, CONTACTS.FIRSTNAME, CONTACTS.MIDDLENAME, CONTACTS.OPENED, CONTACTS.F_PROFIL, (select F_LABEL from admindemosthene.LK_CONT_PROFIL L1081 where L1081.K_CONT_PROFIL=CONTACTS.F_PROFIL) as R_F_PROFIL, (select F_LABEL from admindemosthene.LK_CONT_FACTURE L1153 where L1153.K_CONT_FACTURE=MISS_CONT.F_FACTURE) as R_F_FACTURE, (select NAME from admindemosthene.COMPANIES L1154 where L1154.K_COMPANY=MISS_CONT.F_PARTENAIRE) as R_F_PARTENAIRE, (select F_LABEL from admindemosthene.LK_CONT_TYPE_CONTRAT L1157 where L1157.K_CONT_TYPE_CONTRAT=MISS_CONT.F_TYPE_CONTRAT) as R_F_TYPE_CONTRAT from admindemosthene.MISS_CONT MISS_CONT join admindemosthene.CONTACTS CONTACTS on MISS_CONT.K_CONTACT = CONTACTS.K_CONTACT where (MISS_CONT.K_MISSION = :MISS_CONT_K_MISSION) order by MISS_CONT.MAIN DESC, CONTACTS.NAME&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;Error&lt;/h2&gt;

&lt;p&gt;ESlspException 0&lt;br&gt;
Application Server Error&quot;)&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6190/error-zeos-2174-external-exception-c000001d</guid>
<pubDate>Tue, 22 Jun 2021 13:43:01 +0000</pubDate>
</item>
<item>
<title>duplicate document in workflow</title>
<link>https://overflow.efficy.io/?qa=6153/duplicate-document-in-workflow</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;When a document is duplicated, a couple of values are overwritten to the default values because of the function 'EditInitializedDocu' in the workflow.&lt;/p&gt;

&lt;p&gt;I want to put these lines of code in an if else clause, so the default values are not set when the document is a duplicate from another.&lt;br&gt;
 Is there a way to know if a document is a duplicate in the workflowfunction 'EditInitializedDocu'?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6153/duplicate-document-in-workflow</guid>
<pubDate>Mon, 07 Jun 2021 10:20:36 +0000</pubDate>
</item>
<item>
<title>InsertDetail AfterCommit</title>
<link>https://overflow.efficy.io/?qa=6131/insertdetail-aftercommit</link>
<description>&lt;p&gt;Hello&lt;br&gt;
I'm trying to add a specific project to a case after the commit. It should happen after the commit, because I need to look at the MAINComp to see which project should be linked. If I do it BeforCommit, the CASE&lt;em&gt;COMP relation is not added, so I can't access the K&lt;/em&gt;COMPANY of the MAINComp.&lt;/p&gt;

&lt;p&gt;I execute the following code :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function AfterCommitCase(EditHandle, Inserted) {
    StartDebug('AfterCommitCase')
    CheckEntitySecurity(EditHandle, Inserted, 'Case')   

    if(Inserted) {
        var dsCase = Database.GetMasterDataSet(EditHandle, 0);
        dsCase.Edit    
        var K_CASE = dsCase.FieldByName('K_CASE').AsString
        var EditCase = Database.OpenEditContext(ntCase, K_CASE)
        var SQL = &quot;...&quot;
        var QueryEx = new QueryExecuter();
        var K_PROJECT = QueryEx.FirstColumn(SQL, K_CASE, 0)
        if (K_PROJECT &amp;gt; 0) {
            Database.InsertDetail2(EditCase, ntProj, K_PROJECT, false) 
        }

    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The K_PROJECT that I get returned is correct, but the InsertDetail2 doesn't work. I tried the EditCase but also the EditHandle from the parameter.&lt;/p&gt;

&lt;p&gt;Is there a way to insert details in the AfterCommit or get the CASE_COMP relation in BeforeCommit?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6131/insertdetail-aftercommit</guid>
<pubDate>Thu, 27 May 2021 09:30:44 +0000</pubDate>
</item>
<item>
<title>Reference key of the editHandle</title>
<link>https://overflow.efficy.io/?qa=6119/reference-key-of-the-edithandle</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I have 2 questions please:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Why &lt;code&gt;Efficy.getReferenceToGenerate(editHandle)&lt;/code&gt; returns 0 despite a reference on the opportunity entity exists ?&lt;/li&gt;
&lt;li&gt;What would be the behaviour of the function if I had 2 different references on the opportunity entity ?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What I noticed is :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It will always return 0 if the field &lt;code&gt;REFERENCE&lt;/code&gt; is not displayed or not included in the edit form.&lt;/li&gt;
&lt;li&gt;It will return -1 if the field &lt;code&gt;REFERENCE&lt;/code&gt; is displayed but empty.&lt;/li&gt;
&lt;li&gt;It will return the right reference key if the &lt;code&gt;REFERENCE&lt;/code&gt; field is filled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then, it seems that the usefulness of the &lt;code&gt;Efficy.getReferenceToGenerate(editHandle)&lt;/code&gt; function is quite low if you need to display and fill the &lt;code&gt;REFERENCE&lt;/code&gt; field to get the right key returned...&lt;/p&gt;

&lt;p&gt;Thanks by advance.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6119/reference-key-of-the-edithandle</guid>
<pubDate>Fri, 21 May 2021 10:21:01 +0000</pubDate>
</item>
<item>
<title>Duplication Merge Workflow?</title>
<link>https://overflow.efficy.io/?qa=6106/duplication-merge-workflow</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm trying to execute a script in the workflow trigger PrepareDuplicateMerge but this trigger is called 2 times : &lt;br&gt;
 - once when the page of Duplication is loaded&lt;br&gt;
 - and when we validate our choice to merge&lt;/p&gt;

&lt;p&gt;What i need is to execute only the script when the user submit his choice to merge, could you help me please?&lt;/p&gt;

&lt;p&gt;Thanks&lt;br&gt;
Version : Efficy 11.2&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6106/duplication-merge-workflow</guid>
<pubDate>Wed, 19 May 2021 12:01:12 +0000</pubDate>
</item>
<item>
<title>Break from BeforeCommit</title>
<link>https://overflow.efficy.io/?qa=6104/break-from-beforecommit</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I'm trying to break out of the BeforeCommitCase so AfterCommit is never called, if waiting is a certain value and another field is empty. I tried throwing a new error and returning, but it doesn't seem to work. &lt;/p&gt;

&lt;p&gt;Is there a way to not call AfterCommitCase after BeforeCommitCase?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function AfterCommitCase(EditHandle, Inserted) {
    CheckEntitySecurity(EditHandle, Inserted, 'Case') 
}
function BeforeCommitCase(EditCase, Inserted) {
        var dsCase = Database.GetMasterDataSet(EditCase, 0);
        dsCase.Edit
        var waiting = dsCase.FieldByName('WAITINGFOR').AsString
        var jira = dsCase.FieldByName('F_REMARK').AsString
        try {
           if(waiting == 3 &amp;amp;&amp;amp; (jira == &quot;&quot; || jira == null)) {
                throw new Error(&quot;Please fill in the JIRA-task&quot;)
            }
        }
        catch (ex) {
            EfficyJavaAlert(ex);
           return;
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6104/break-from-beforecommit</guid>
<pubDate>Tue, 18 May 2021 13:21:08 +0000</pubDate>
</item>
<item>
<title>Delete WrkAlloc function in workflow</title>
<link>https://overflow.efficy.io/?qa=6079/delete-wrkalloc-function-in-workflow</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I'm trying to add a custom code to our Efficy workflow regarding the allocations in the new project module.&lt;/p&gt;

&lt;p&gt;I managed to do something when the allocation is being placed, but I would like to reverse that actions when an allocation is deleted.&lt;/p&gt;

&lt;p&gt;When an allocation is being placed, the function AfterCommitWrkAlloc works perfectly fine. On deleting, I can't seem to manage to find the right function for the deletion; both onDeleteWrkAlloc(EditHandle, Key) &amp;amp; onBeforeDeleteWrkAlloc(EditHandle, Key) don't seem to work. The function is not called when I debug.&lt;/p&gt;

&lt;p&gt;What function should I call when to do something before the allocation is deleted?&lt;/p&gt;

&lt;p&gt;Thank you in advance!&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6079/delete-wrkalloc-function-in-workflow</guid>
<pubDate>Tue, 11 May 2021 13:31:35 +0000</pubDate>
</item>
<item>
<title>is there a way to make difference between '' and null value in a dataset returned by an sqlQueryDataset</title>
<link>https://overflow.efficy.io/?qa=6075/difference-between-value-dataset-returned-sqlquerydataset</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;When using something like &lt;code&gt;dataSetToJson(Efficy.sqlQueryDataset(MyQuery, &quot;&quot;))&lt;/code&gt; the result give me '' (empty value) for empty value fields, but also for null value fields.&lt;/p&gt;

&lt;p&gt;i've an idea of workaround with a coalesce in the query, but ... is there a standard or a better way to get the &quot;real&quot; null value ?&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6075/difference-between-value-dataset-returned-sqlquerydataset</guid>
<pubDate>Mon, 10 May 2021 13:34:56 +0000</pubDate>
</item>
<item>
<title>set datetime with fieldbyname</title>
<link>https://overflow.efficy.io/?qa=6041/set-datetime-with-fieldbyname</link>
<description>&lt;p&gt;Hello&lt;/p&gt;

&lt;p&gt;I am trying to set a datetime for an action, based on D_START of an allocation.&lt;/p&gt;

&lt;p&gt;I managed to get the correct date, but the time is not saved. It just says &quot;02/05/2021 00:00:00&quot; instead of &quot;02/05/2021 08:00:00&quot;. When I debug, the variable has the correct time, but the fieldbyname does not seem to take it correctly.&lt;/p&gt;

&lt;p&gt;Another issue I am having with my code is that the &lt;code&gt;P_D_BEGIN&lt;/code&gt; and &lt;code&gt;P_D_END&lt;/code&gt; are set to be the same value, but when I execute it, &lt;code&gt;P_D_END&lt;/code&gt; is 1 lower than &lt;code&gt;P_D_BEGIN&lt;/code&gt;, which ofcourse is not possible, since your end date cannot be before the begin date.&lt;/p&gt;

&lt;p&gt;I have the following code now (after second possible answer):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function AfterCommitWrkAlloc(EditHandle, Inserted){
        StartDebug('AfterCommitWrkAlloc')
        CheckEntitySecurity(EditHandle, Inserted, 'WrkAlloc')

    //get data for queries
    var ds = Database.GetMasterDataSet(EditHandle, 0)
    var K_PROJECT = ds.FieldByName('K_PROJECT').AsFloat
    var D_START = ds.FieldByName('D_START').AsDateTime
    var K_TEAMMEMBER = ds.FieldByName('K_TEAMMEMBER').AsInteger
    var KIND = ds.FieldByName('KIND').AsInteger
    var LOCKED = ds.FieldByName('LOCKED').AsInteger

    //get variables with the data
    var location = (LOCKED == 1? 3 : 4) //When lock is set then location is onsite, else offsite
    var action_kind = (LOCKED == 1? 14 : 15) //allocations onsite or offsite

    var date_start = (KIND==0? incHour(D_START, 8) : incHour(D_START, 13));
    var date_end = (KIND==0? incHour(D_START, 12) : incHour(D_START, 17));

    var QueryEx = new QueryExecuter();
    var SQL = &quot;SELECT top(1) NAME FROM ArdisICT.PROJECTS where K_PROJECT=:param1&quot;;
    var SQL2 = &quot;select K_USER from ArdisICT.R_WRK_TEAMMEMBERS where K_TEAMMEMBER =:param1 and K_PROJECT =:param2&quot;;
    var projectname = QueryEx.FirstColumn(SQL, K_PROJECT, 0) + ' | ' + (LOCKED == 1? 'onsite' : 'remote');
    var k_user = QueryEx.FirstColumn(SQL2, K_TEAMMEMBER + '\n' + K_PROJECT, 0);

    //create action with the correct time, user, project, Kind, nature and location
var EditAct = Database.OpenEditContext(ntActi, 0);
var K_ACTION = Database.GetEditKey(EditAct);
var dsAction = Database.GetMasterDataSet(EditAct, 0);
dsAction.Edit;

dsAction.FieldByName(&quot;D_BEGIN&quot;).AsFloat = date_start;
    dsAction.FieldByName(&quot;D_END&quot;).AsFloat = date_end;
dsAction.FieldByName(&quot;KIND&quot;).AsInteger = action_kind;
    dsAction.FieldByName(&quot;LOCATION&quot;).AsInteger = location;
dsAction.FieldByName(&quot;SUBJECT&quot;).AsString = projectname;


Database.InsertDetail2(EditAct, ntProj, K_PROJECT, false);
Database.SetUsers(EditAct, k_user, false, false);

Database.CommitChanges(EditAct, false);
    var teststart = dsAction.FieldByName(&quot;D_BEGIN&quot;).AsFloat;

    //create relation between allocation and action.
    ds.Edit;
    ds.FieldByName('F_K_ACTION').AsString = K_ACTION
    Database.CommitChanges(EditHandle, false);    
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The result after debugging the code:&lt;br&gt;
&lt;img src=&quot;https://overflow.efficy.io/?qa=blob&amp;amp;qa_blobid=11165665211375892477&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6041/set-datetime-with-fieldbyname</guid>
<pubDate>Mon, 26 Apr 2021 10:34:11 +0000</pubDate>
</item>
<item>
<title>Efficy function varArrayOf is not working under Efficy 11.3.23950</title>
<link>https://overflow.efficy.io/?qa=6008/efficy-function-vararrayof-not-working-under-efficy-23950</link>
<description>&lt;p&gt;Dear All,&lt;/p&gt;

&lt;p&gt;At a customer we used the varArrayOf function to translate JavaScript array into Array of Variants : &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-varArrayOf&quot;&gt;&lt;/a&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-varArrayOf&quot;&gt;https://help.efficy.io/edn/serverjs#Library-varArrayOf&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;But it is seems that it is not working in Efficy 11.3.23950.0&lt;/p&gt;

&lt;p&gt;Here is the test I did to show that it is not working in a standard Efficy.&lt;br&gt;
I created a scheduleScript with this code, which is pretty straight forward : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/*
@import &quot;ecma&quot;;
*/
function main() {
var users = [1,2,3,4]
var userArr = varArrayOf(users);
Efficy.log('\r\nUsers:' + JSON.stringify(users) + '\r\nUsers Array Of: ' + JSON.stringify(userArr));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And here is the result :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[2021/04/02 12:38:46.018] 
[2021/04/02 12:38:46.018] === Run Job ===
[2021/04/02 12:38:46.042] [Efficy113Std - 2] 
[2021/04/02 12:38:46.042] [Efficy113Std - 2] ========================================================================================
[2021/04/02 12:38:46.042] [Efficy113Std - 2] Task 2: Test usersInGroup
[2021/04/02 12:38:46.042] [Efficy113Std - 2] Log on Database Efficy113Std - User ADMIN113
[2021/04/02 12:38:46.084] [Efficy113Std - 2] Load Script File: C:\inetpub\wwwroot\11.3\customs\default\efficy\serverjs\testUsersInGroups.js
[2021/04/02 12:38:46.085] [Efficy113Std - 2] ----------------------------------------------------------------------------------------
[2021/04/02 12:38:46.086] [Efficy113Std - 2] 
Users:[1,2,3,4]
Users Array Of: undefined
[2021/04/02 12:38:46.086] [Efficy113Std - 2] ========================================================================================
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6008/efficy-function-vararrayof-not-working-under-efficy-23950</guid>
<pubDate>Fri, 02 Apr 2021 10:46:02 +0000</pubDate>
</item>
<item>
<title>Efficy usersInGroup function is not working under Efficy 11.3.23950</title>
<link>https://overflow.efficy.io/?qa=6007/efficy-usersingroup-function-not-working-under-efficy-23950</link>
<description>&lt;p&gt;Dear All,&lt;/p&gt;

&lt;p&gt;For a customer we used the server side function &quot;Efficy.usersInGroup&quot; : &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Efficy-usersInGroup&quot;&gt;https://help.efficy.io/edn/serverjs#Efficy-usersInGroup&lt;/a&gt;&lt;br&gt;
But it seems this function is not working in Efficy 11.3.23950.0 &lt;/p&gt;

&lt;p&gt;Here is the test I did to show that this is not working, I created a scheduleScript with this code : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/*
@import &quot;ecma&quot;;
*/
function main() {
var users = Efficy.usersInGroup(99999002);
Efficy.log('Users in admin group: ' + JSON.stringify(users));
var users = Efficy.usersInGroup(1);
Efficy.log('Users in admin group: ' + JSON.stringify(users));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And here is the result :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[2021/04/02 12:17:59.532] === Run Job ===
[2021/04/02 12:17:59.549] [Efficy113Std - 2] 
[2021/04/02 12:17:59.549] [Efficy113Std - 2] ========================================================================================
[2021/04/02 12:17:59.549] [Efficy113Std - 2] Task 2: Test usersInGroup
[2021/04/02 12:17:59.549] [Efficy113Std - 2] Log on Database Efficy113Std - User ADMIN113
[2021/04/02 12:17:59.605] [Efficy113Std - 2] Load Script File: C:\inetpub\wwwroot\11.3\customs\default\efficy\serverjs\testUsersInGroups.js
[2021/04/02 12:17:59.606] [Efficy113Std - 2] ----------------------------------------------------------------------------------------
[2021/04/02 12:17:59.608] [Efficy113Std - 2] Users in admin group: undefined
[2021/04/02 12:17:59.608] [Efficy113Std - 2] Users in admin group: undefined
[2021/04/02 12:17:59.608] [Efficy113Std - 2] ========================================================================================
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6007/efficy-usersingroup-function-not-working-under-efficy-23950</guid>
<pubDate>Fri, 02 Apr 2021 10:25:36 +0000</pubDate>
</item>
<item>
<title>EntityCatalogue get Relation table Name is empty ?</title>
<link>https://overflow.efficy.io/?qa=5995/entitycatalogue-get-relation-table-name-is-empty</link>
<description>&lt;p&gt;Dear All,&lt;/p&gt;

&lt;p&gt;At a customer we have use the following code in order to get the relation table name between a project and an e-Mail, but the result is an empty string.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var relationTableName = Efficy.entityCatalog.getRelationEntityTableName(20, 33);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The Table MAIL_PROJ exist in the database.&lt;/p&gt;

&lt;p&gt;I am pretty sure there is a configuration to make this entityCatalog methode working, but I don't know where. &lt;/p&gt;

&lt;p&gt;Does someone know in which SYS_table I should look to make it work ?&lt;/p&gt;

&lt;p&gt;Best Regards&lt;br&gt;
Stéphane Roncin&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5995/entitycatalogue-get-relation-table-name-is-empty</guid>
<pubDate>Thu, 25 Mar 2021 10:00:47 +0000</pubDate>
</item>
<item>
<title>UserSession.ExecuteCommand alternative to make it work in Save of Action, and not only in Apply</title>
<link>https://overflow.efficy.io/?qa=5890/usersession-executecommand-alternative-make-action-apply</link>
<description>&lt;p&gt;A customer wants to open an opportunity after it has been created in the beforeCommitActi. They use &lt;/p&gt;

&lt;p&gt;UserSession.ExecuteCommand(&quot;Edit('Oppo',K_Opportunity)&quot;);&lt;/p&gt;

&lt;p&gt;for this.&lt;/p&gt;

&lt;p&gt;Works fine when doing an apply, but not when doing a Save (and close) it does not execute.&lt;/p&gt;

&lt;p&gt;What is the correct way to achieve this functionality in an Efficy 11.3?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5890/usersession-executecommand-alternative-make-action-apply</guid>
<pubDate>Thu, 11 Feb 2021 09:30:16 +0000</pubDate>
</item>
<item>
<title>FlexMail Synchro Exception &quot;Query TimeOut&quot;</title>
<link>https://overflow.efficy.io/?qa=5875/flexmail-synchro-exception-query-timeout</link>
<description>&lt;p&gt;For a customer with intensive use of FlexMail emailings, a query of the FlexMail synchro  can lead to a timeout.&lt;/p&gt;

&lt;p&gt;To avoid this, specify a user &lt;strong&gt;WITHOUT FULL ACCESS&lt;/strong&gt; to run the synchro scheduled script !&lt;br&gt;
Thanks to Alain Pegurri for the solution!&lt;/p&gt;

&lt;p&gt;I've tried to find a simple explanation but I have no special skill to understand execution plans. &lt;br&gt;
Would someone like to analyze them, I've stored some elements in the following  &lt;a rel=&quot;nofollow&quot; href=&quot;https://submariners.efficy.com/crm/view/Docu/438752&quot;&gt;submariners document&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;sql statement, &lt;/li&gt;
&lt;li&gt;execution plans with (0&amp;lt;&amp;gt;0 or...) and without (1&amp;lt;&amp;gt;0 or...) security&lt;/li&gt;
&lt;li&gt;Execution Plans Comparison screenshot&lt;/li&gt;
&lt;li&gt;Index properties&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to contact me if you need extra info'.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5875/flexmail-synchro-exception-query-timeout</guid>
<pubDate>Mon, 08 Feb 2021 16:22:03 +0000</pubDate>
</item>
<item>
<title>Efficy.sendExternalEmail creates wrong URL - where can we correct the behaviour?</title>
<link>https://overflow.efficy.io/?qa=5832/efficy-sendexternalemail-creates-wrong-correct-behaviour</link>
<description>&lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;if we you the built in &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Efficy.sendExternalMail(sendFrom, sendTo, sendCc, subject, body, entity, idLinked, sendCode) 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;function and set the parameter sendCode = 'S' &lt;br&gt;
The added URL to the mail follow the Efficy 10 schema:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;https://mydomain.here/efficy.dll/dialog?page=remote/DialogOperation.htm&amp;amp;action=view;Cont;99958&amp;amp;close=T
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;instead it should look like: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;https://mydomain.here/crm/view/Cont/99958
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Where can we change this behavior?&lt;/p&gt;

&lt;p&gt;Thank you &lt;/p&gt;

&lt;p&gt;Tim&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5832/efficy-sendexternalemail-creates-wrong-correct-behaviour</guid>
<pubDate>Wed, 27 Jan 2021 11:11:08 +0000</pubDate>
</item>
<item>
<title>Catching exceptions in triggered workflow event</title>
<link>https://overflow.efficy.io/?qa=5811/catching-exceptions-in-triggered-workflow-event</link>
<description>&lt;p&gt;We discovered a behavior in Efficy workflow that we did not expect. The script below demonstrates the use case with a simple example. On the commit of an action, the main linked opportunity gets an update (e.g status). When an error occurs in the BeforeCommitOppo, the error is catched by &lt;code&gt;BeforeCommitActi&lt;/code&gt; but still thrown by the script to Efficy and the commit gets aborted.&lt;/p&gt;

&lt;p&gt;Why is this like this?&lt;/p&gt;

&lt;p&gt;The error is &lt;strong&gt;not catched&lt;/strong&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function BeforeCommitActi(editActi, inserted) {
    var k_Opportunity = Efficy.getMainDetail(editActi, ntOppo),
        editOppo;
    if (!k_Opportunity) return;
    try {
        editOppo = Efficy.openEditContext(ntOppo, k_Opportunity)
        Efficy.commitChanges(editOppo, false);
    } catch(ex) {
        Efficy.log(&quot;Exception catched: &quot; + ex.message);
    } finally {
        editOppo &amp;amp;&amp;amp; Efficy.closeContext(editOppo);
    }
 }
 function BeforeCommitOppo(editOppo, inserted) {
     throw new Error('This error should be catched!');
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;A workaround we found is the solution below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function BeforeCommitActi(editActi, inserted) {
    var k_Opportunity = Efficy.getMainDetail(editActi, ntOppo),
        editOppo;
    if (!k_Opportunity) return;
    try {
        editOppo = Efficy.openEditContext(ntOppo, k_Opportunity)
        Efficy.disableWorkflow = true;
        BeforeCommitOppo(editOppo, false);
        Efficy.commitChanges(editOppo, false);
    } catch(ex) {
        Efficy.log(&quot;Exception catched: &quot; + ex.message);
    } finally {
        Efficy.disableWorkflow = false;
        editOppo &amp;amp;&amp;amp; Efficy.closeContext(editOppo);
    }
 }
 function BeforeCommitOppo(editOppo, inserted) {
     throw new Error('This error should be catched!');
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Still, we don't get it.&lt;br&gt;
Is this behavior intended?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: Tested the same script (but with Database instead of Efficy) in Efficy 2012 (8.0) and the behavior is different. My guess is that the behavior changed when the script collision issues have been handled&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5811/catching-exceptions-in-triggered-workflow-event</guid>
<pubDate>Tue, 19 Jan 2021 13:40:46 +0000</pubDate>
</item>
<item>
<title>Error using Addlink2</title>
<link>https://overflow.efficy.io/?qa=5784/error-using-addlink2</link>
<description>&lt;p&gt;Hello,&lt;br&gt;
I'm currently having a problem with the following function :&lt;/p&gt;

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

&lt;p&gt;The idea is to link all the children profiles when linking a profile to a contact.&lt;/p&gt;

&lt;p&gt;I get the following error message :&lt;/p&gt;

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

&lt;p&gt;For some reason, it does not work. Maybe I did not see something obvious but at least it should not raise an error since I passed &quot;true&quot; as fifth argument.&lt;/p&gt;

&lt;p&gt;One last thing, it sometimes works with some profiles, and does not with some others...&lt;/p&gt;

&lt;p&gt;Thanks for your help.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5784/error-using-addlink2</guid>
<pubDate>Mon, 04 Jan 2021 13:31:50 +0000</pubDate>
</item>
<item>
<title>Prevent &quot;subprojects&quot; from being determined as content to be secured</title>
<link>https://overflow.efficy.io/?qa=5777/prevent-subprojects-from-being-determined-content-secured</link>
<description>&lt;p&gt;By default, when the content of a project is secured. This content-security is applied to mails, documents and actions by default. The entities to be considered as &quot;content&quot; can be extended by adding a field to the entity and adding that entity in the settings (ContentEntities). &lt;/p&gt;

&lt;p&gt;However, a subproject which is linked to a project (PROJ_PROJ) is always considered as content to be secured, regardless of the settings. *And these subprojects will have the same content-security settings*&lt;/p&gt;

&lt;p&gt;Is it somehow possible to customize Efficy so that the linked subprojects are not considered as &quot;Content to be secured&quot; ?&lt;/p&gt;

&lt;p&gt;This is highly requested by one of our customers in The Netherlands.&lt;br&gt;
Thanks for any help.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5777/prevent-subprojects-from-being-determined-content-secured</guid>
<pubDate>Fri, 18 Dec 2020 13:19:24 +0000</pubDate>
</item>
</channel>
</rss>