<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions and answers in WorkFlow / Serverscript</title>
<link>https://overflow.efficy.io/?qa=qa/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>Answered: Syntax for function OnAddLinkOppoPubl(Key, DetailKey)</title>
<link>https://overflow.efficy.io/?qa=7172/syntax-for-function-onaddlinkoppopubl-key-detailkey&amp;show=7175#a7175</link>
<description>&lt;p&gt;Hello Dimitri,&lt;/p&gt;

&lt;p&gt;If you are linking the Publication from Opportunity you will enter into OnAddLinkOppoPubl(Key, DetailKey). &lt;br&gt;
In this case the Key parameter is a key of the Opportunity.&lt;br&gt;
You will need to openEditContext of the opportunity and update the field.&lt;br&gt;
ex.: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var editOppo= Efficy.openEditContext(ntOppo, Key);
try {
  Efficy.updateField(editOppo, 0, &quot;STATUS&quot;, STATUSVAL);
  Efficy.commitChanges(editOppo, false);
} finally {
  Efficy.closeContext(editOppo);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you want to avoid the workflow events of Opportunity be triggered during the status update don't forget to include disableWorkflow property.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var editOppo= Efficy.openEditContext(ntOppo, Key);
Efficy.disableWorkflow = true;
try {
  Efficy.updateField(editOppo, 0, &quot;STATUS&quot;, STATUSVAL);
  Efficy.commitChanges(editOppo, false);
} finally {
  Efficy.disableWorkflow = false;
  Efficy.closeContext(editOppo);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Implement the logic in bidirectional if needed: OnAddLinkPublOppo(Key, DetailKey), where Opportunity key will be then DetailKey.&lt;/p&gt;

&lt;p&gt;Kind regards,&lt;br&gt;
Hamid&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7172/syntax-for-function-onaddlinkoppopubl-key-detailkey&amp;show=7175#a7175</guid>
<pubDate>Wed, 14 May 2025 10:09:19 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=7165#a7165</link>
<description>&lt;p&gt;Hi Stefan&lt;/p&gt;

&lt;p&gt;Efficy does not expose a workflow event that fires when entity records are consulted or queried. When existing entity records are edited, the event &lt;strong&gt;OnEditingXxxx&lt;/strong&gt; can be implemented to update a field value of the dataset before it gets displayed. This is where you could decrypt it.&lt;/p&gt;

&lt;p&gt;I'm not sure it helps you?&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&amp;show=7165#a7165</guid>
<pubDate>Mon, 24 Feb 2025 09:26:10 +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>Answered: 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&amp;show=7116#a7116</link>
<description>&lt;p&gt;When working with setUserSecurity in ServerJs, it's best to execute it in a block where Efficy.disableSecurity === true.&lt;/p&gt;

&lt;p&gt;It's because the current user has for instance &lt;strong&gt;no Delete table rights&lt;/strong&gt;, but gives group Everyone or &lt;strong&gt;other users &quot;Full Control&quot;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This protection prevents users giving user security &quot;Full&quot; on a record and override Table rights for themselves or others. In a script context, this is often exactly what you want to do.&lt;/p&gt;

&lt;p&gt;Thank you to Kristof for his help.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=7115/efficy-setusersecurity-assign-security-level-default-right&amp;show=7116#a7116</guid>
<pubDate>Thu, 26 Sep 2024 15:46:36 +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>Answered: 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&amp;show=6966#a6966</link>
<description>&lt;p&gt;Fixed&lt;/p&gt;

&lt;p&gt;Business-data-providers was set in dealer base, &lt;br&gt;
CustomLabels from that custom took over your the regular customlabels.&lt;/p&gt;

&lt;p&gt;Deactivated of the dealer base, is for now a workarround.&lt;/p&gt;

&lt;p&gt;Next time I could check, the dealerbase label conflicts first.&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&amp;show=6966#a6966</guid>
<pubDate>Fri, 08 Sep 2023 15:15:46 +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>Answered: actionlauncher: open Oppo Edit</title>
<link>https://overflow.efficy.io/?qa=6930/actionlauncher-open-oppo-edit&amp;show=6931#a6931</link>
<description>&lt;p&gt;The actionLauncher is a custom extension of the standard &lt;code&gt;efficy/js/misc/action&lt;/code&gt; module that is responsible to parse the URL action verbs such as &lt;code&gt;createRelation, refreshOpener, runTemplate&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The custom module is invoked by overriding the action.launch method. When you hit apply in an edit window, just like the standard &quot;action&quot; commands are not executed, it's the same story for the workflow defined action verbs.&lt;/p&gt;

&lt;p&gt;I'm not sure that hooking up the module to a command such as &quot;Apply&quot; will give a stable result. It's quite tricky.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6930/actionlauncher-open-oppo-edit&amp;show=6931#a6931</guid>
<pubDate>Fri, 16 Jun 2023 05:59:45 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6912#a6912</link>
<description>&lt;p&gt;You should disable the security before you open the editContext.&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&amp;show=6912#a6912</guid>
<pubDate>Thu, 01 Jun 2023 09:35:00 +0000</pubDate>
</item>
<item>
<title>Answered: Cannot access certain field of Product in template</title>
<link>https://overflow.efficy.io/?qa=6879/cannot-access-certain-field-of-product-in-template&amp;show=6882#a6882</link>
<description>&lt;p&gt;In a merge context, only fields and categories from the merged entity (Document in your example) + the fields from the relation datasets are available. The field &lt;code&gt;PRODUCTS.FAMILY&lt;/code&gt; is not accessible because it's not from the relation &lt;code&gt;DOCU_PROD&lt;/code&gt;. Efficy does some special tricks for common fields &lt;code&gt;[NAME, OPENED, SUBJECT, DONE]&lt;/code&gt; but not for the others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Options:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy &lt;code&gt;R_FAMILY&lt;/code&gt; from ProdDataSet to &lt;code&gt;DOCU_PROD.COMMENT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Create a custom field and copy &lt;code&gt;FAMILY&lt;/code&gt; from ProdDataSet to &lt;code&gt;DOCU_PROD.F_FAMILY&lt;/code&gt;. You also need to implicitly set &lt;code&gt;R_F_FAMILY&lt;/code&gt; unless you commit the document.&lt;/li&gt;
&lt;li&gt;Use a template script to complete your product table with additional fields from Products.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The best option depends on the amount of Product fields you need and your skills and time. The first is surely the easiest.&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&amp;show=6882#a6882</guid>
<pubDate>Mon, 17 Apr 2023 05:54:11 +0000</pubDate>
</item>
<item>
<title>Answered: Do we have a workflow trigger for workStages?</title>
<link>https://overflow.efficy.io/?qa=6828/do-we-have-a-workflow-trigger-for-workstages&amp;show=6829#a6829</link>
<description>&lt;p&gt;It is &lt;code&gt;AfterCommitWrkStag&lt;/code&gt;&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&amp;show=6829#a6829</guid>
<pubDate>Mon, 27 Feb 2023 17:28:21 +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>Answered: 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&amp;show=6791#a6791</link>
<description>&lt;p&gt;Here is the R&amp;amp;D answer:&lt;/p&gt;

&lt;p&gt;Indeed, the particular case delete for file as detail is not handled.&lt;br&gt;
You can get the detail dataset, and call its delete method.&lt;br&gt;
Either you loop on the dataset and delete when the &lt;code&gt;K_FILE&lt;/code&gt; corresponds, or you can use the dataset.locate method.&lt;br&gt;
If you pass the &lt;code&gt;K_FILE;VERSION&lt;/code&gt;, then you can position the dataset on the exact record you want to delete.&lt;br&gt;
If you pass only the &lt;code&gt;K_FILE&lt;/code&gt; the it positions on the first one; you can then iterate (locate returns false when no record is found)&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6789/delete-detail-attachements-contains-efficy-document-revision&amp;show=6791#a6791</guid>
<pubDate>Mon, 09 Jan 2023 14:25:25 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6782#a6782</link>
<description>&lt;p&gt;Have you set the Administrator Email of the Mail Dispatch Service ? if so the Administrator should have received the error saying the email could not be sent.&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/admin/scpr_systemmaildispatchproperties&quot;&gt;&lt;/a&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/admin/scpr_systemmaildispatchproperties&quot;&gt;https://help.efficy.io/edn/admin/scpr_systemmaildispatchproperties&lt;/a&gt;&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&amp;show=6782#a6782</guid>
<pubDate>Tue, 20 Dec 2022 16:44:49 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6761#a6761</link>
<description>&lt;p&gt;It seems that it is working if csv file is converted into AINSI in place of UTF8/UTF8-BOM&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&amp;show=6761#a6761</guid>
<pubDate>Mon, 14 Nov 2022 13:00:53 +0000</pubDate>
</item>
<item>
<title>Answered: set a dataset field to null</title>
<link>https://overflow.efficy.io/?qa=6735/set-a-dataset-field-to-null&amp;show=6736#a6736</link>
<description>&lt;p&gt;Hi &lt;/p&gt;

&lt;p&gt;You can use &lt;code&gt;DataSet.fieldByName('F_FIELD').Clear();&lt;/code&gt;&lt;br&gt;
See &lt;a rel=&quot;nofollow&quot; href=&quot;https://docwiki.embarcadero.com/Libraries/Sydney/en/Data.DB.TField.Clear&quot;&gt;Data.DB.TField.Clear&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But, that being said, it is much better to make your (SQL) queries that use the F_FIELD smarter by handling &quot;&quot; and NULL as the same. Efficy does it automatically, but in SQL you must use &lt;code&gt;NVL&lt;/code&gt; or &lt;code&gt;coalesce&lt;/code&gt;.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6735/set-a-dataset-field-to-null&amp;show=6736#a6736</guid>
<pubDate>Tue, 25 Oct 2022 10:18:17 +0000</pubDate>
</item>
<item>
<title>Answered: Encoding issue using OpenUrlSecure</title>
<link>https://overflow.efficy.io/?qa=6721/encoding-issue-using-openurlsecure&amp;show=6722#a6722</link>
<description>&lt;p&gt;Yes, this is a known limitation in that version of openUrlSecure. That's why the new API method was added in superior versions. Upgrading is the only path to success here&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6721/encoding-issue-using-openurlsecure&amp;show=6722#a6722</guid>
<pubDate>Fri, 14 Oct 2022 07:25:48 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6605#a6605</link>
<description>&lt;p&gt;Hello Laurent,&lt;/p&gt;

&lt;p&gt;I don't think you can use Request in scheduled task context.&lt;/p&gt;

&lt;p&gt;See comment in &lt;strong&gt;&lt;em&gt;/serverjs/invoicing/utils.js &amp;gt; translate()&lt;/em&gt;&lt;/strong&gt;  -&amp;gt; &lt;code&gt;// Prevent error when Request is not available in context (ex: scheduled task)&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;if (typeof Request !== 'undefined') { // Prevent error when Request is not available in context (ex: scheduled task)
return Request.translate(label);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;In case of Spycase.js looks like it sends email to the case manager and the body message is base on MAILS object.&lt;br&gt;
You might have to customize Spycase.js. and map translation directly in to it.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var MAILS = {
Close: {
EN: &quot;The case has been closed by the SpyCase.&quot;,
FR: &quot;....&quot;
},
Remind : {
EN: &quot;The Customer/Partner has not replied in $0 days.\nPlease send a reminder or tentatively close the case.&quot;,
FR: &quot;....&quot;
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;OR&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var MAILS = {
EN: {
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;
},
FR: {
Close  : &quot;....&quot;,
Remind : &quot;....&quot;
}
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Based on case manager language you can select the needed translation.&lt;br&gt;
Be careful you will  need to review all references of MAILS in Spycase.js to adapt the translation. &lt;em&gt;MAILS[ManagerLanguage or by default EN].Close, MAILS.[ManagerLanguage or by default EN]&lt;/em&gt;.Links, etc.&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&amp;show=6605#a6605</guid>
<pubDate>Tue, 21 Jun 2022 11:54:32 +0000</pubDate>
</item>
<item>
<title>Answered: Opportunity : set Linked Prod read only</title>
<link>https://overflow.efficy.io/?qa=6599/opportunity-set-linked-prod-read-only&amp;show=6600#a6600</link>
<description>&lt;p&gt;Hello Sébastien,&lt;/p&gt;

&lt;p&gt;There is no security on the links in Efficy Entreprise.&lt;br&gt;
But there is an option in SYS_SETTINGS of &quot;Efficy&quot; : relationSecurityLevel&lt;br&gt;
Level of permissions on the relations. 0 = None, 1 = One, 2 = Both.&lt;/p&gt;

&lt;p&gt;cf &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/settings&quot;&gt;EDN settings&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/admin/dsgn_relationsecuritylevel&quot;&gt;EDN relationSecurityLevel&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope this will help you&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6599/opportunity-set-linked-prod-read-only&amp;show=6600#a6600</guid>
<pubDate>Wed, 15 Jun 2022 07:38:20 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6598#a6598</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
You can use these 2 functions:&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-directoryExists&quot;&gt;https://help.efficy.io/edn/serverjs#Library-directoryExists&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-createDir&quot;&gt;https://help.efficy.io/edn/serverjs#Library-createDir&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var path =  &quot;C:\\dir\\&quot;;  
if (!directoryExists(path)) createDir(path);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Kr,&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&amp;show=6598#a6598</guid>
<pubDate>Tue, 14 Jun 2022 17:55:25 +0000</pubDate>
</item>
<item>
<title>Answered: How to convert windows 1252 to UTF-8 ?</title>
<link>https://overflow.efficy.io/?qa=6592/how-to-convert-windows-1252-to-utf-8&amp;show=6593#a6593</link>
<description>&lt;p&gt;Hi Luc,&lt;/p&gt;

&lt;p&gt;Did you try this method: &lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Efficy-openUrlSecureUtf8&quot;&gt;https://help.efficy.io/edn/serverjs#Efficy-openUrlSecureUtf8&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Kr,&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&amp;show=6593#a6593</guid>
<pubDate>Fri, 10 Jun 2022 17:02:52 +0000</pubDate>
</item>
<item>
<title>Answered: How to read file from form (POST)</title>
<link>https://overflow.efficy.io/?qa=6527/how-to-read-file-from-form-post&amp;show=6528#a6528</link>
<description>&lt;p&gt;Dear Max,&lt;/p&gt;

&lt;p&gt;I don't think there is a cleaner way than the one you trying to achieve which is parsing the raw content of the request.&lt;/p&gt;

&lt;p&gt;Here you can fin an example using a node endpoint for pictures:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://overflow.efficy.io/?qa=4394/upload-documents-files-from-a-guest-page&amp;amp;show=4394#q4394&quot;&gt;https://overflow.efficy.io/?qa=4394/upload-documents-files-from-a-guest-page&amp;amp;show=4394#q4394&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your other form values are then set into contentParts[X].&lt;/p&gt;

&lt;p&gt;If you are inside Efficy you must use the FileHelper library btw.&lt;/p&gt;

&lt;p&gt;Kr,&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6527/how-to-read-file-from-form-post&amp;show=6528#a6528</guid>
<pubDate>Mon, 09 May 2022 11:32:28 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6371#a6371</link>
<description>&lt;p&gt;Thanks to Kristof to pointing me this out:&lt;br&gt;
If you don't have Delete Table Rights, you can like not to give Full Control permissions (security). I think this GUI filtering is a way to prevent the &quot;You cannot give permissions that you don't have&quot; kind of error.&lt;/p&gt;

&lt;p&gt;This is also something that was corrected along the way, since 11.2 (&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/dev/rlhs_efficy112&quot;&gt;build 16235&lt;/a&gt;):&lt;br&gt;
&lt;code&gt;Editing: the owner of the record can always modify the security, even when the record is “read-only”. (This feature was lost in Efficy 2014.)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;: this is not an error of Efficy. This is standard behavior in order to avoid error message when committing. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reminder&lt;/strong&gt;: Combining rights and securities: which ones prevail?&lt;br&gt;
When rights conflict with securities, apply this rule: the most restrictive setting wins!&lt;/p&gt;

&lt;p&gt;Cf EDN to learn more about right and securities: &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/admin/dsgn_rightssecurities&quot;&gt;https://help.efficy.io/edn/admin/dsgn_rightssecurities&lt;/a&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&amp;show=6371#a6371</guid>
<pubDate>Fri, 26 Nov 2021 11:03:12 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6358#a6358</link>
<description>&lt;p&gt;Hi Laurent&lt;/p&gt;

&lt;p&gt;You could use the ProjUtil module &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides#projutils%C2%A7users&quot;&gt;Users&lt;/a&gt; to get a JS Array of all resources in the Application. Then you can check if the user is contained in the resources list with &lt;code&gt;.find&lt;/code&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function isResource (k_User) {
    return Users.getResources().find(function(u) {
        return u.K_USER === k_User;
    }).K_USER &amp;gt; 0;
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6356/how-to-reset-user-using-setusers-true-except-resources&amp;show=6358#a6358</guid>
<pubDate>Wed, 17 Nov 2021 11:46:25 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6330#a6330</link>
<description>&lt;p&gt;Try working with &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-smartCompressEx&quot;&gt;smartCompressEx&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Library-smartDecompressEx&quot;&gt;smartDecompressEx&lt;/a&gt; around streams. See a usage example of compressing &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/files_overview#convert-linked-files-to-embedded-with-a-scheduled-script&quot;&gt;here&lt;/a&gt; and decompression &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/files_overview#download-a-file-through-node&quot;&gt;here&lt;/a&gt;.&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&amp;show=6330#a6330</guid>
<pubDate>Wed, 20 Oct 2021 13:25:41 +0000</pubDate>
</item>
<item>
<title>Answered: Efficy.currentUserCode() is returning email address</title>
<link>https://overflow.efficy.io/?qa=6269/efficy-currentusercode-is-returning-email-address&amp;show=6275#a6275</link>
<description>&lt;p&gt;I'm not convinced it is possible to make a normal user session using your email address.&lt;br&gt;
Maybe it was related to Azure AD authentication and an &quot;older&quot; version of Efficy...&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6269/efficy-currentusercode-is-returning-email-address&amp;show=6275#a6275</guid>
<pubDate>Wed, 01 Sep 2021 13:08:45 +0000</pubDate>
</item>
<item>
<title>Answered: format settings difference between efficy and scheduleur</title>
<link>https://overflow.efficy.io/?qa=6262/format-settings-difference-between-efficy-and-scheduleur&amp;show=6264#a6264</link>
<description>&lt;p&gt;we just find another solution with Pascal using this&lt;/p&gt;

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

&lt;p&gt;in place of this&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;formatDateTime(&quot;yyyy/mm/dd hh:nn:ss&quot;, dateItemNomenclature)
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6262/format-settings-difference-between-efficy-and-scheduleur&amp;show=6264#a6264</guid>
<pubDate>Thu, 26 Aug 2021 11:41:23 +0000</pubDate>
</item>
<item>
<title>Answered: Error in FieldByName</title>
<link>https://overflow.efficy.io/?qa=6254/error-in-fieldbyname&amp;show=6257#a6257</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Why are you passing the K_COMPANY to the OpenConsultContext function ?&lt;br&gt;
Regarding the API reference : &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Efficy-openConsultContext&quot;&gt;https://help.efficy.io/edn/serverjs#Efficy-openConsultContext&lt;/a&gt;&lt;br&gt;
It just needs the entity ; then you use Efficy.consult() to open the record and retrieve the dataset.&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;
Sébastien&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6254/error-in-fieldbyname&amp;show=6257#a6257</guid>
<pubDate>Thu, 19 Aug 2021 09:09:55 +0000</pubDate>
</item>
<item>
<title>Answered: Call EditInitializedPackProd on edit and on add</title>
<link>https://overflow.efficy.io/?qa=6205/call-editinitializedpackprod-on-edit-and-on-add&amp;show=6206#a6206</link>
<description>&lt;p&gt;Hi Janne&lt;/p&gt;

&lt;p&gt;What happens in the front (a click of button) does not always translate into a unqiue server-side operation. So, knowing &quot;what button&quot; what pressed on the server is not possible.&lt;/p&gt;

&lt;p&gt;What I recommend is that you try the &lt;code&gt;OnEditingXxxxYyyy&lt;/code&gt; and &lt;code&gt;AfterInsertXxxxYyyy&lt;/code&gt; events. See the order of execution in this schema.&lt;/p&gt;

&lt;p&gt;Still, &lt;code&gt;inserted&lt;/code&gt; should be true anyway when it concerns a new (non committed) entity (or relation) record.&lt;/p&gt;

&lt;p&gt;Learn more about &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/workflow_events#sample2_insert_new_task_from_contact&quot;&gt;Efficy workflow here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://help.efficy.io/extras//projectguides/guides/workflow_events/assets/wfe_order_editrelation.svg&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=6205/call-editinitializedpackprod-on-edit-and-on-add&amp;show=6206#a6206</guid>
<pubDate>Tue, 29 Jun 2021 13:56:01 +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>Answered: duplicate document in workflow</title>
<link>https://overflow.efficy.io/?qa=6153/duplicate-document-in-workflow&amp;show=6195#a6195</link>
<description>&lt;p&gt;Efficy support helped me out and I got it working with the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var docuName = Efficy.getFieldValue(edithandle, 'NAME')
var nbDuplicates = Efficy.sqlQueryValue('select count(k_document) from documents where name=:p1', docuName, 0)

if ( nbDuplicates &amp;gt; 0) return
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6153/duplicate-document-in-workflow&amp;show=6195#a6195</guid>
<pubDate>Wed, 23 Jun 2021 08:01:02 +0000</pubDate>
</item>
<item>
<title>Answered: Error : (ZEOS-2174) External exception C000001D</title>
<link>https://overflow.efficy.io/?qa=6190/error-zeos-2174-external-exception-c000001d&amp;show=6191#a6191</link>
<description>&lt;p&gt;Does the query succesfully executes when you run it in MSSQL, while replacing the &lt;code&gt;:MISS_CONT_K_MISSION&lt;/code&gt; parameter with &lt;code&gt;0&lt;/code&gt;?&lt;/p&gt;

&lt;p&gt;Since the error is external exception, I would look for an external cause first.&lt;/p&gt;

&lt;p&gt;Is it always or randomly occuring? &lt;br&gt;
Other queries too?&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6190/error-zeos-2174-external-exception-c000001d&amp;show=6191#a6191</guid>
<pubDate>Tue, 22 Jun 2021 14:24:28 +0000</pubDate>
</item>
<item>
<title>Answered: InsertDetail AfterCommit</title>
<link>https://overflow.efficy.io/?qa=6131/insertdetail-aftercommit&amp;show=6132#a6132</link>
<description>&lt;p&gt;Hi Janne&lt;/p&gt;

&lt;p&gt;Always use the API methods to get relational information in favor of SQL queries. The reason is that you cannot query the database in before commit, because it's not yet committed to the DB.&lt;/p&gt;

&lt;p&gt;There are two methods you can use. For a single value, use the first&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;Efficy.getMainDetail(EditHandle, ntComp);&lt;/code&gt; Returns the main linked &lt;code&gt;K_COMPANY&lt;/code&gt; key&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Efficy.getDetailDataSet(EditHandle, ntComp);&lt;/code&gt; Returns a TDataSet of &lt;code&gt;CASE_COMP&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6131/insertdetail-aftercommit&amp;show=6132#a6132</guid>
<pubDate>Thu, 27 May 2021 10:07:41 +0000</pubDate>
</item>
<item>
<title>Answered: Reference key of the editHandle</title>
<link>https://overflow.efficy.io/?qa=6119/reference-key-of-the-edithandle&amp;show=6122#a6122</link>
<description>&lt;p&gt;EDN documentation explains &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Efficy-getReferenceToGenerate&quot;&gt;getReferenceToGenerate(editHandle)&lt;/a&gt; like this: &lt;/p&gt;

&lt;p&gt;&lt;em&gt;In &lt;strong&gt;BeforeCommit&lt;/strong&gt; events, retrieves the key of the reference that will be applied when committing the edit context.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So, it means it has only use in &lt;code&gt;BeforeCommit&lt;/code&gt; (not in &lt;code&gt;AfterCommit&lt;/code&gt;), when a reference has been selected and before it is applied (=generated).&lt;/p&gt;

&lt;p&gt;With this event, you could conditionally execute logic in the BeforeCommit instead of AfterCommit, because you already know what reference will be applied. Think about activating a category for instance. Or you could also implement custom security rules and abort the commit if the person cannot select the reference for some reason.&lt;/p&gt;

&lt;p&gt;Conditionaly logic on reference should be made on both &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/serverjs#Efficy-getReferenceToGenerate&quot;&gt;getReferenceToGenerate(editHandle)&lt;/a&gt; and the value of &lt;code&gt;REFERENCE&lt;/code&gt;.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6119/reference-key-of-the-edithandle&amp;show=6122#a6122</guid>
<pubDate>Tue, 25 May 2021 06:34:13 +0000</pubDate>
</item>
<item>
<title>Answered: Duplication Merge Workflow?</title>
<link>https://overflow.efficy.io/?qa=6106/duplication-merge-workflow&amp;show=6107#a6107</link>
<description>&lt;p&gt;Indeed, &lt;code&gt;PrepareDuplicateMerge&lt;/code&gt; is fired multiple times as explained in &lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/workflow_events#sample4_merging_two_contacts&quot;&gt;this topic&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It looks like you need the fairly new &lt;code&gt;AfterDuplicateMerge&lt;/code&gt; event introduced in Efficy 11.3. I highly recommend to postpone the development until the customer can be upgraded to Efficy 11.3 or newer.&lt;/p&gt;

&lt;p&gt;This new worfklow event was delivered because handling merges in prior versions was very hard!&lt;/p&gt;

&lt;p&gt;Related material:&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/workflow_events#sample4_merging_two_contacts&quot;&gt;Workflow events&lt;/a&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/projectguides/duplicate_merging&quot;&gt;Duplicate Merging&lt;/a&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6106/duplication-merge-workflow&amp;show=6107#a6107</guid>
<pubDate>Wed, 19 May 2021 13:14:58 +0000</pubDate>
</item>
<item>
<title>Answered: Break from BeforeCommit</title>
<link>https://overflow.efficy.io/?qa=6104/break-from-beforecommit&amp;show=6105#a6105</link>
<description>&lt;p&gt;You have to abort the workflow by throwing an exception and &lt;strong&gt;not catching it&lt;/strong&gt;. The custom EfficyJavaAlert that you execute in the catch does not throw an exception. So remove the try/catch and just let the Error fire.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6104/break-from-beforecommit&amp;show=6105#a6105</guid>
<pubDate>Wed, 19 May 2021 05:58:02 +0000</pubDate>
</item>
<item>
<title>Answered: Delete WrkAlloc function in workflow</title>
<link>https://overflow.efficy.io/?qa=6079/delete-wrkalloc-function-in-workflow&amp;show=6083#a6083</link>
<description>&lt;p&gt;Hi Janne&lt;/p&gt;

&lt;p&gt;Because JavaScript is case sensitive, the trigger workflow function names are too. Your function should be &lt;code&gt;OnBeforeDeleteWrkAlloc&lt;/code&gt; or &lt;code&gt;OnAfterDeleteWrkAlloc&lt;/code&gt;. I see you made a mistake with the first letter.&lt;/p&gt;

&lt;p&gt;FYI, these are the events that are fired when you just delete a single Allocation from the planning.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;// Events caused by ServerJs method Planning.removeAllocationItem
OnEditingWrkTeam
OnBeforeDeleteWrkAlloc
OnAfterDeleteWrkAlloc

// Events caused by ServerJS method Planning.pushToHistory
OnEditingProj
BeforeCommitProj
AfterCommitProj
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6079/delete-wrkalloc-function-in-workflow&amp;show=6083#a6083</guid>
<pubDate>Wed, 12 May 2021 06:11:34 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6076#a6076</link>
<description>&lt;p&gt;Hi Vincent, there is no standard workaround for this. I also like and prefer this default behavior with respect to the datatype conversion. Not only strings, but also NULL numbers are forced to &lt;code&gt;0&lt;/code&gt; when JSON converted.&lt;/p&gt;

&lt;p&gt;Logic that depends on wether a string is &lt;code&gt;''&lt;/code&gt;, &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;NULL&lt;/code&gt; is to be avoided anyway. So, I would suggest to accept the difference and work your way around it, instead of trying to build a solution with coalesce&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6075/difference-between-value-dataset-returned-sqlquerydataset&amp;show=6076#a6076</guid>
<pubDate>Mon, 10 May 2021 14:24:31 +0000</pubDate>
</item>
<item>
<title>Answered: set datetime with fieldbyname</title>
<link>https://overflow.efficy.io/?qa=6041/set-datetime-with-fieldbyname&amp;show=6059#a6059</link>
<description>&lt;p&gt;Efficy Appointments and Tasks are both actions, but only Appointments have a time component and appear in the agenda.&lt;/p&gt;

&lt;p&gt;You can't have tasks with a specific start time. So, you must set &lt;code&gt;PLANNED='1'&lt;/code&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=6041/set-datetime-with-fieldbyname&amp;show=6059#a6059</guid>
<pubDate>Tue, 27 Apr 2021 10:04:41 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=6014#a6014</link>
<description>&lt;p&gt;Hi Stéphane&lt;/p&gt;

&lt;p&gt;Efficy API method usersInGroup returns an olevariant. You need to use the specific varArrayLowBound and  varArrayHighBound to loop through it. It's actually wel documented...&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function userInGroup(userId, groupId) {
  var users = Efficy.usersInGroup(groupId);
  if (!users)
    return false;
  for (var i = varArrayLowBound(users, 1); i &amp;lt;= varArrayHighBound(users, 1); i++) {
    var userId2 = varArrayElement(users, i);
    if (userId2 === userId)
      return true;
  }
  return false;
}
&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&amp;show=6014#a6014</guid>
<pubDate>Sat, 03 Apr 2021 16:42:08 +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>Answered: EntityCatalogue get Relation table Name is empty ?</title>
<link>https://overflow.efficy.io/?qa=5995/entitycatalogue-get-relation-table-name-is-empty&amp;show=6003#a6003</link>
<description>&lt;p&gt;Hello Stephane,&lt;/p&gt;

&lt;p&gt;The method getRelationEntityTableName searches for the name in SYS_RELENTITIES that does not contain this relation in standard. You can add it in custom.&lt;br&gt;
Regards,&lt;/p&gt;

&lt;p&gt;Pascal&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5995/entitycatalogue-get-relation-table-name-is-empty&amp;show=6003#a6003</guid>
<pubDate>Thu, 01 Apr 2021 10:52:09 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=5895#a5895</link>
<description>&lt;p&gt;Hello Stijn&lt;/p&gt;

&lt;p&gt;We published a new module + project guide that allows you to control client-side actions, such as &lt;code&gt;alert&lt;/code&gt;, &lt;code&gt;view&lt;/code&gt; or &lt;code&gt;edit&lt;/code&gt; from a workflow event.&lt;/p&gt;

&lt;p&gt;&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;/p&gt;

&lt;p&gt;This module is 11.2+ compatible.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5890/usersession-executecommand-alternative-make-action-apply&amp;show=5895#a5895</guid>
<pubDate>Fri, 12 Feb 2021 11:11:39 +0000</pubDate>
</item>
<item>
<title>Answered: FlexMail Synchro Exception &quot;Query TimeOut&quot;</title>
<link>https://overflow.efficy.io/?qa=5875/flexmail-synchro-exception-query-timeout&amp;show=5884#a5884</link>
<description>&lt;p&gt;First of all, having or not a fullaccess user will change the parts of the statements to evaluate, so clearly this does generate a different strategy for execution in the SQL server.&lt;br&gt;
That being said, we see in the &quot;slow&quot; (I guess this is the one &quot;without security &quot;), that 86% of time is spent on the Primary key lookup on PROF&amp;#95;CONT... &lt;br&gt;
My understanding is that with full access, the inner join (&quot;PROFJOIN&quot; table) will load way too much records, that will need to be joined to contacts that also have not been reduced via security, and this is only the other &lt;code&gt;where&lt;/code&gt; clauses that will reduce the final dataset IMO.&lt;br&gt;
I would have a look at the index fragmentation on PKPROF_CONT index.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5875/flexmail-synchro-exception-query-timeout&amp;show=5884#a5884</guid>
<pubDate>Wed, 10 Feb 2021 14:15:29 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=5833#a5833</link>
<description>&lt;p&gt;Hello Tim&lt;/p&gt;

&lt;p&gt;You will need to modify the &lt;code&gt;meetingInvitationURL&lt;/code&gt; property&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Prefix to construct the links that allow to accept and decline a&lt;br&gt;
  meeting invitations by e-mail. Example: &lt;a rel=&quot;nofollow&quot; href=&quot;http://eff.efficy.com/crm/&quot;&gt;http://eff.efficy.com/crm/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can search this settings property on this page.&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; href=&quot;https://help.efficy.io/edn/settings&quot;&gt;https://help.efficy.io/edn/settings&lt;/a&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5832/efficy-sendexternalemail-creates-wrong-correct-behaviour&amp;show=5833#a5833</guid>
<pubDate>Wed, 27 Jan 2021 11:50:07 +0000</pubDate>
</item>
<item>
<title>Answered: Catching exceptions in triggered workflow event</title>
<link>https://overflow.efficy.io/?qa=5811/catching-exceptions-in-triggered-workflow-event&amp;show=5818#a5818</link>
<description>&lt;p&gt;This was indeed observed, and due to a non reset of a flag when an uncatched exception had happened in a second internal invocation of a serverJS method (&lt;br&gt;
&lt;code&gt;commit entityX -&amp;gt; workflow JS -&amp;gt; commit entityY -&amp;gt; workflow JS&lt;/code&gt; with uncatched exception) in that case the exception would be raised all the way up to the delphi context. &lt;/p&gt;

&lt;p&gt;Well spotted !&lt;/p&gt;

&lt;p&gt;This is solved in svn r24164 and will be shipped in future builds.&lt;/p&gt;

&lt;p&gt;KR,&lt;br&gt;
Yann&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5811/catching-exceptions-in-triggered-workflow-event&amp;show=5818#a5818</guid>
<pubDate>Thu, 21 Jan 2021 09:11:00 +0000</pubDate>
</item>
<item>
<title>Answered: Error using Addlink2</title>
<link>https://overflow.efficy.io/?qa=5784/error-using-addlink2&amp;show=5785#a5785</link>
<description>&lt;p&gt;Hi Mathieu&lt;/p&gt;

&lt;p&gt;Efficy does not have a solid foreign key constraint check on &lt;code&gt;entity_entity&lt;/code&gt; relation tables such as &lt;code&gt;PROF_PROF, PROD_PROD, COMP_COMP&lt;/code&gt; etc. It means, that when you delete the entity, it does not delete the records from the tree correctly.&lt;/p&gt;

&lt;p&gt;So, you likely have selected a &lt;code&gt;K_PROFILE2&lt;/code&gt; that does no longer exist in &lt;code&gt;PROFILES&lt;/code&gt;, hence the constraint violation you have in the error.&lt;/p&gt;

&lt;p&gt;There error is quite specific actually ;-)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Join &lt;code&gt;PROFILES&lt;/code&gt; to exclude orphaned &lt;code&gt;PROF_PROF.K_PROFILE2&lt;/code&gt; relations&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5784/error-using-addlink2&amp;show=5785#a5785</guid>
<pubDate>Mon, 04 Jan 2021 14:01:17 +0000</pubDate>
</item>
<item>
<title>Answered: 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&amp;show=5782#a5782</link>
<description>&lt;p&gt;When you link a project as a child to a parent project with security inheritance enabled, the project inherits the security and content security. It's a one time initialisation caused by the linking operation.&lt;/p&gt;

&lt;p&gt;From that moment, you can indepentenly alter the content security of the child project.&lt;/p&gt;

&lt;p&gt;When you place an existing project with content security enabled inside a tree, it will not inherit the security.&lt;/p&gt;

&lt;p&gt;Tested this morning with Efficy 12.0&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5777/prevent-subprojects-from-being-determined-content-secured&amp;show=5782#a5782</guid>
<pubDate>Mon, 04 Jan 2021 06:54:48 +0000</pubDate>
</item>
</channel>
</rss>