<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged script</title>
<link>https://overflow.efficy.io/?qa=tag/script</link>
<description>Powered by Question2Answer</description>
<item>
<title>Autocompletion of ServerScript method and priority with VSCode</title>
<link>https://overflow.efficy.io/?qa=4399/autocompletion-serverscript-method-priority-with-vscode</link>
<description>&lt;p&gt;Hey guys, would be so nice to have an autocompletion of every method and property inside VSCode, i hope someone will developpe something soon. &lt;/p&gt;

&lt;p&gt;Like that we can developpe more faster and be more productive !&lt;/p&gt;
</description>
<category>Utilities</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=4399/autocompletion-serverscript-method-priority-with-vscode</guid>
<pubDate>Mon, 03 Jun 2019 12:20:18 +0000</pubDate>
</item>
<item>
<title>Making a consultViewCustom to launch custom script @display of screen in consult mode</title>
<link>https://overflow.efficy.io/?qa=3629/making-consultviewcustom-launch-custom-display-consult</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;i would like to make a consultViewCustom system, like what we do for making an editViewCustom.&lt;/p&gt;

&lt;p&gt;so, i've made a consultView.js&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;define([
    'require',
    'standard/views/consultView'
], function(require, ConsultView) {

    // Conditionally load custom consult views
    console.log('Conditionally load custom consult views');
    switch (Model('entity')) {
        case &quot;Comp&quot;:
            require([&quot;custom/views/consultViewComp&quot;], function(consultViewCustom) {consultViewCustom.start();});
            break;
    }

    return ConsultView;
});
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;who is loaded with &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;RequireConfigCustom {[
  &amp;lt;%UseScript('custom/js/config/require.config.js')%&amp;gt;
]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;it is working, but it seems that it is not always loaded,  i need to make a F5 to load it.&lt;/p&gt;

&lt;p&gt;i suppose that &lt;code&gt;ConsultView.start();&lt;/code&gt; (from consult.js) is executed when we do F5 but not when we for exemple make a company search and click on it to consult the company.&lt;/p&gt;

&lt;p&gt;I don't see where i can force to start again my consultView  (or any other/better way to do that)&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3629/making-consultviewcustom-launch-custom-display-consult</guid>
<pubDate>Fri, 26 Oct 2018 07:58:23 +0000</pubDate>
</item>
<item>
<title>Error on running script on auto mail uploader</title>
<link>https://overflow.efficy.io/?qa=2444/error-on-running-script-on-auto-mail-uploader</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm trying to run a script on uploading email and convert it to task using auto mail uploader (though &quot;script&quot; field in configuration of mail uploader), but i'm getting the following error when i run the service like in the screenshot below.&lt;/p&gt;

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

&lt;p&gt;The script is like the following, simply link a user to created task:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    function BeforeCommit(EditHandle, Inserted){
    LinkUserToAction(EditHandle, Inserted);
}

function LinkUserToAction(EditHandle, Inserted){
    var USER = 4;
    Database.SetUsers(EditHandle, USER, false);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Please advise.&lt;/p&gt;

&lt;p&gt;Thank you in advance for your help.&lt;/p&gt;

&lt;p&gt;Best Regards.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2444/error-on-running-script-on-auto-mail-uploader</guid>
<pubDate>Thu, 20 Apr 2017 13:13:32 +0000</pubDate>
</item>
<item>
<title>Script trigger action grids on mark done/undone</title>
<link>https://overflow.efficy.io/?qa=1765/script-trigger-action-grids-on-mark-done-undone</link>
<description>&lt;p&gt;Hi guys,&lt;/p&gt;

&lt;p&gt;Can somebody point me in the right direction to create a script from the Action GridColumns mark done/undone trigger?&lt;/p&gt;

&lt;p&gt;Regards,&lt;/p&gt;

&lt;p&gt;Michael&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1765/script-trigger-action-grids-on-mark-done-undone</guid>
<pubDate>Fri, 15 Jul 2016 09:25:31 +0000</pubDate>
</item>
<item>
<title>Template Script Return value containing $$ENCODE$$</title>
<link>https://overflow.efficy.io/?qa=1440/template-script-return-value-containing-encode</link>
<description>&lt;p&gt;Dear All,&lt;/p&gt;

&lt;p&gt;I get the following Template Script from Efficy France and there is a particularity in it.&lt;br&gt;
It return the value $$ENCODE$$ ... so what is it?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/*
usage
[$RunScript(name=&quot;GetListeParticipants1&quot;, file=&quot;DMS_CRSIPP&quot;,TypeResultat=&quot;var&quot;)]
var= ['NOMPRENOMFONCTION'] 
*/
function GetListeParticipants1(ContextHandle) {
                var K_DOCU = Database.GetFieldValue(ContextHandle, 'K_DOCUMENT')

                var Type = Variables.Values('TypeResultat')

                var QueryHandle;
                var SQLQuery = &quot; SELECT CONTACTS.K_CONTACT, CONTACTS.NAME,CONTACTS.FIRSTNAME, &quot; +
                               &quot; CONT_COMP.JOBTITLE &quot;+
                               &quot; from &amp;lt;#table name = 'DOCU_CONT'&amp;gt; DOCU_CONT &quot;+
                               &quot; INNER JOIN &amp;lt;#table name = 'CONTACTS'&amp;gt; CONTACTS &quot;+
                               &quot; ON DOCU_CONT.K_CONTACT = CONTACTS.K_CONTACT &quot;+
                               &quot; LEFT OUTER JOIN &amp;lt;#table name = 'CONT_COMP'&amp;gt; CONT_COMP &quot;+
                               &quot; ON (CONTACTS.K_CONTACT = CONT_COMP.K_CONTACT AND CONT_COMP.D_END IS NULL AND CONT_COMP.MAIN = '1') &quot;+
                               &quot; LEFT OUTER JOIN &amp;lt;#table name = 'COMPANIES'&amp;gt; COMPANIES &quot;+
                               &quot; ON CONT_COMP.K_COMPANY = COMPANIES.K_COMPANY &quot; +
                               &quot; where DOCU_CONT.K_DOCUMENT = :PARAM1&quot;;

                var Result='';

                var QueryContextHandle = Database.OpenTemporaryContext;
                    var ResultDS = Database.ExecuteSystemSQLQuery(QueryHandle, QueryContextHandle, SQLQuery, K_DOCU, true, true, 0);
                    ResultDS.First;
                    while (!ResultDS.Eof) {
                        var RESULTTEMP=ResultDS.FieldByName('JOBTITLE').AsString;
                        if (Type=='NOMPRENOMFONCTION' &amp;amp;&amp;amp; RESULTTEMP &amp;lt; 64) 
                            Result = Result +ResultDS.FieldByName('NAME').AsString +' '+ResultDS.FieldByName('FIRSTNAME').AsString +'[$LF]'+ResultDS.FieldByName('JOBTITLE').AsString +'[$LF]'+'[$LF]';
                        else
                            Result = Result +ResultDS.FieldByName('NAME').AsString +' '+ResultDS.FieldByName('FIRSTNAME').AsString +'[$LF]'+ResultDS.FieldByName('JOBTITLE').AsString +'[$LF]';
                        ResultDS.Next   
                    }
                return &quot;$$ENCODE$$&quot;+Result;
}
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1440/template-script-return-value-containing-encode</guid>
<pubDate>Tue, 22 Mar 2016 08:48:40 +0000</pubDate>
</item>
<item>
<title>Modify security on parent project and update all subsequent projects+dcouments</title>
<link>https://overflow.efficy.io/?qa=1266/modify-security-parent-project-subsequent-projects-dcouments</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I have project records(parent) that have projects and document under (children), and i want ot update the parent security in script and i need to be reflected to children. the filed &quot;CONTENTSECURED&quot; is already on. But it's not reflected to the children.&lt;/p&gt;

&lt;p&gt;the structure is as in the snapshot (paretn is &quot;ANBE_50604&quot; and all projects and sub-projects and all documents linked to parent directly or to its sub-projects need to be updated)&lt;/p&gt;

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

&lt;p&gt;Please let me know your advise.&lt;br&gt;
Thank you.&lt;br&gt;
Best Regards.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1266/modify-security-parent-project-subsequent-projects-dcouments</guid>
<pubDate>Fri, 22 Jan 2016 12:31:51 +0000</pubDate>
</item>
<item>
<title>upload mail to efficy from script</title>
<link>https://overflow.efficy.io/?qa=1158/upload-mail-to-efficy-from-script</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;I'm using datasync to parse directory and upload all email in it to Efficy. I've tried to use the usual way of insertAttachment to newly created Mail &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ImportFiles.prototype.ImportFile = function(EditMail, FilePath, FileName) {
        Database.InsertAttachment(EditMail, 1, FilePath);
        var AttachmentText = StrLoadBinaryFile(FilePath); 
        var FileDS = Database.GetDetailDataSet(EditMail, ntFile);  
        FileDS.Edit;
        FileDS.FieldByName('STREAM').AsString = AttachmentText;
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'FILESIZE', AttachmentText.length); 
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'PATH', FilePath); 
        Database.UpdateDetail(EditMail, ntFile, 0, 0, 'COMMENT', FileName);
        Database.CommitChanges(EditMail, false);
        Database.CloseContext(EditMail);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;but i'm getting error:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Error during CommitChanges on &quot;Mail&quot;: Could not convert variant of&lt;br&gt;
  type (Null) into type (Double)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Please advise.&lt;br&gt;
thank you.&lt;br&gt;
Best Regards.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1158/upload-mail-to-efficy-from-script</guid>
<pubDate>Fri, 08 Jan 2016 16:31:27 +0000</pubDate>
</item>
</channel>
</rss>