<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged serverscript</title>
<link>https://overflow.efficy.io/?qa=tag/serverscript</link>
<description>Powered by Question2Answer</description>
<item>
<title>Error Object expected in InsertAttachment method</title>
<link>https://overflow.efficy.io/?qa=5475/error-object-expected-in-insertattachment-method</link>
<description>&lt;pre&gt;&lt;code&gt;var EditHandle = Database.OpenEditContext(ntDocu, K_DOCUMENT)
try {
    var fileKey = Database.InsertAttachment(EditHandle, ftInserted, myFilePath);  
    /* Code goes on after */
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;I got the following error when I am using InsertAttachment method :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Error: Object expected
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I tried to replace ftInserted by the number 1, also tried various format for my filePath ( 'example.pdf', 'c:/mypath/example.pdf'&lt;/p&gt;

&lt;p&gt;I have no clue what the method is expecting at this point..&lt;/p&gt;

&lt;p&gt;Any ideas ?&lt;/p&gt;

&lt;p&gt;Efficy 10 Sp2&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=5475/error-object-expected-in-insertattachment-method</guid>
<pubDate>Fri, 05 Jun 2020 16:32:56 +0000</pubDate>
</item>
<item>
<title>Updating field in Category on which current user has no rights</title>
<link>https://overflow.efficy.io/?qa=3305/updating-field-in-category-on-which-current-user-has-rights</link>
<description>&lt;p&gt;Updating fiel in Category on which user has no rights from a serverscript, is this possible ?&lt;/p&gt;

&lt;p&gt;Database.DisableSecurity = true doesn't have an effect.&lt;/p&gt;

&lt;p&gt;Error stays &quot;Category &quot;DOCU$INVOICING&quot; does not exist or is not active&lt;/p&gt;

&lt;p&gt;I use : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Database.UpdateCategory(EditDocuHandle, &quot;DOCU$INVOICING&quot;, &quot;F_INVOICE_STATUS&quot;, statusValue);
&lt;/code&gt;&lt;/pre&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=3305/updating-field-in-category-on-which-current-user-has-rights</guid>
<pubDate>Fri, 15 Jun 2018 14:17:36 +0000</pubDate>
</item>
<item>
<title>[Efficy 10] Image in template received by HTTP request</title>
<link>https://overflow.efficy.io/?qa=3021/efficy-10-image-in-template-received-by-http-request</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I have to add an image into a template which is received by HTTP request (post) from a serverscript. I don't find any way to append it on .rtf template.&lt;/p&gt;

&lt;p&gt;When the request is done, I save the image on HDD (I didn't found an other way to save the binary, if you have something, I take!) and now, I should add this image on template.&lt;/p&gt;

&lt;p&gt;How can I do it, please ?&lt;br&gt;
Thanks 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=3021/efficy-10-image-in-template-received-by-http-request</guid>
<pubDate>Tue, 03 Apr 2018 07:04:18 +0000</pubDate>
</item>
<item>
<title>get the result of a select statement to an array of object</title>
<link>https://overflow.efficy.io/?qa=2924/get-the-result-of-a-select-statement-to-an-array-of-object</link>
<description>&lt;p&gt;Dear developper community &lt;/p&gt;

&lt;p&gt;Just before Kristof tells me why it's not good^^ let s take a minute to celebrate my new Achievement : I finally found a way to convert Dataset to Array of Objects in javascript. please note that this is the result of delphi Recordset objects researches on the web plus lot of tests.&lt;/p&gt;

&lt;p&gt;I give you the result of my code as a tribute for the great Efficy developpers community^^.&lt;/p&gt;

&lt;p&gt;this is how it works : in my example I try to get &lt;code&gt;all the STATUS_FR and K_OPPO_STATUS from the LK_OPPO_STATUS table ENALBED and with K_OPPO_STATUS lesser than 5&lt;/code&gt;&lt;br&gt;
do you remember doing something like this : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;var
    result = new Array(),
    qh = 0,
    context = Database.OpenTemporaryContext(),
    sql = &quot;select * from &amp;lt;#TABLE NAME=LK_OPPO_STATUS&amp;gt; where DISABLED = :param1 and K_OPPO_STATUS &amp;lt; :param2&quot;,
    params = [0, 5].join(&quot;\n&quot;),
    ds = Database.ExecuteSystemSQLQuery(qh, context, sql, params, true, true, 1);

while (!ds.EoF){

    result.push({
        status: ds.FieldByName(&quot;STATUS&quot;).AsString,
        k_oppo_status: ds.FieldByName(&quot;K_OPPO_STATUS&quot;).AsFloat      
    });

    ds.Next();
}

return result; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;that gave you : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[  
   {  
      &quot;status_fr&quot;:&quot;01. Prise de contact&quot;,
      &quot;k_oppo_status&quot;:1
   },
   {  
      &quot;status_fr&quot;:&quot;02. Qualification&quot;,
      &quot;k_oppo_status&quot;:2
   },
   {  
      &quot;status_fr&quot;:&quot;03. Démonstration&quot;,
      &quot;k_oppo_status&quot;:3
   },
   {  
      &quot;status_fr&quot;:&quot;04. Offre&quot;,
      &quot;k_oppo_status&quot;:4
   }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this time my friends is over! now you can do : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;return jsonSelectSQL(&quot;select * from &amp;lt;#TABLE NAME=LK_OPPO_STATUS&amp;gt; where DISABLED = :param1 and K_OPPO_STATUS &amp;lt; :param2&quot;, 0, 5);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Note that at this point YOU don't need to specify anything about the fields names or number of fields.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;which will give you something like &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[  
   {  
      &quot;k_oppo_status&quot;:1,
      &quot;k_sort&quot;:1,
      &quot;k_label&quot;:0,
      &quot;status&quot;:&quot;01. Initial Contact&quot;,
      &quot;disabled&quot;:&quot;0&quot;,
      &quot;status_fr&quot;:&quot;01. Prise de contact&quot;,
      &quot;status_nl&quot;:&quot;01. Prise de contact&quot;,
      &quot;status_es&quot;:&quot;01. Prise de contact&quot;,
      &quot;status_de&quot;:&quot;01. Prise de contact&quot;,
      &quot;status_ja&quot;:&quot;&quot;,
      &quot;status_pl&quot;:&quot;&quot;,
      &quot;status_tr&quot;:&quot;&quot;,
      &quot;status_ar&quot;:&quot;&quot;,
      &quot;f_pending&quot;:1
   },
   {  
      &quot;k_oppo_status&quot;:2,
      &quot;k_sort&quot;:2,
      &quot;k_label&quot;:0,
      &quot;status&quot;:&quot;02. Qualification&quot;,
      &quot;disabled&quot;:&quot;0&quot;,
      &quot;status_fr&quot;:&quot;02. Qualification&quot;,
      &quot;status_nl&quot;:&quot;02. Accroche&quot;,
      &quot;status_es&quot;:&quot;02. Accroche&quot;,
      &quot;status_de&quot;:&quot;02. Accroche&quot;,
      &quot;status_ja&quot;:&quot;&quot;,
      &quot;status_pl&quot;:&quot;&quot;,
      &quot;status_tr&quot;:&quot;&quot;,
      &quot;status_ar&quot;:&quot;&quot;,
      &quot;f_pending&quot;:1
   },
   {  
      &quot;k_oppo_status&quot;:3,
      &quot;k_sort&quot;:3,
      &quot;k_label&quot;:0,
      &quot;status&quot;:&quot;03. Démonstration&quot;,
      &quot;disabled&quot;:&quot;0&quot;,
      &quot;status_fr&quot;:&quot;03. Démonstration&quot;,
      &quot;status_nl&quot;:&quot;03. Démonstration&quot;,
      &quot;status_es&quot;:&quot;03. Démonstration&quot;,
      &quot;status_de&quot;:&quot;03. Démonstration&quot;,
      &quot;status_ja&quot;:&quot;&quot;,
      &quot;status_pl&quot;:&quot;&quot;,
      &quot;status_tr&quot;:&quot;&quot;,
      &quot;status_ar&quot;:&quot;&quot;,
      &quot;f_pending&quot;:1
   },
   {  
      &quot;k_oppo_status&quot;:4,
      &quot;k_sort&quot;:4,
      &quot;k_label&quot;:0,
      &quot;status&quot;:&quot;04. Offre&quot;,
      &quot;disabled&quot;:&quot;0&quot;,
      &quot;status_fr&quot;:&quot;04. Offre&quot;,
      &quot;status_nl&quot;:&quot;04. Offre&quot;,
      &quot;status_es&quot;:&quot;04. Offre&quot;,
      &quot;status_de&quot;:&quot;04. Offre&quot;,
      &quot;status_ja&quot;:&quot;&quot;,
      &quot;status_pl&quot;:&quot;&quot;,
      &quot;status_tr&quot;:&quot;&quot;,
      &quot;status_ar&quot;:&quot;&quot;,
      &quot;f_pending&quot;:1
   }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;note that if you strictly want the same result as before you can do : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;return jsonSelectSQL(&quot;select STATUS_FR, K_OPPO_STATUS from &amp;lt;#TABLE NAME=LK_OPPO_STATUS&amp;gt; where DISABLED = :param1 and K_OPPO_STATUS &amp;lt; :param2&quot;, 0, 5);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;this is the code of jsonSelectSQL : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function jsonSelectSQL(){

    var 
        ds = selectSQL.apply(null, arguments),
        result = new Array(),
        fields = new Array();

    ds.First();
    if (!ds.EoF) {
        for (var i=0; i&amp;lt;ds.Fields.count; i++){
            fields.push(ds.Fields(i).FieldName);
        }
    }
    while (!ds.EoF){
        var obj = {};

        for (var i=0; i&amp;lt;fields.length; i++) {
            var temp = ds.FieldByName(fields[i]).Value;
            switch(typeof(temp)){
                case &quot;string&quot;:
                    obj[fields[i].toLowerCase()] = temp;
                    break;
                case &quot;number&quot;: 
                    obj[fields[i].toLowerCase()] = Number(temp);
                    break;
                default: 
                    obj[fields[i].toLowerCase()] = temp;
                    break;
            }
        }
        result.push(obj);

        ds.Next();
    }
    return result;
}   
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;please note that you will need this code as well : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;//------(simple closure to don't have to remember which StoreId to use)
var nextStoreId = (function(){
    var storeId = 0;
    return function(){return storeId += 1;};
})();

//------(call this with sql string and parameters and you will get the standard dataset)
function selectSQL(){
    var 
        args = arrayFrom(arguments),
        qh = 0, 
        context = Database.OpenTemporaryContext(),
        sql = args[0],
        params = args.splice(0,1),
        ds = Database.ExecuteSystemSQLQuery(qh, context, sql, params.join(&quot;\n&quot;), true, true, nextStoreId());

    return ds;
}

//-----(convert the classic arguments arraylike object as a regular javascript array)
function arrayFrom(_arg){

    var result = new Array();

    for (var i=0; i&amp;lt;_arg.length; i++){
        result.push(_arg[i]);
    }

    return result;
}   

//-----(home made splice prototype polyfill, feel free to use yours)
Array.prototype.splice = function(){
    var args = arguments;

    var result = new Array();
    var i = 0;

    if (args[0] + args[1] &amp;gt; this.length) throw new Error(&quot;custom Splice error, invalid parameters for this array&quot;);
    while (i &amp;lt; args[0]){
        result.push(this[i]);
        i++;
    }

    if (args[2])    for (var j=0; j&amp;lt;args[2].length; j++) result.push(args[2][j]);

    i = args[0] + args[1];

    while (i&amp;lt;this.length){
        result.push(this[i]);
        i++;
    }

    for (i=0; i&amp;lt;this.length; i++) this[i] = undefined;
    this.length = 0;
    for (i=0; i&amp;lt;result.length; i++) this.push(result[i]);

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

&lt;p&gt;since a lot of code can be necessary I invite to use my previous achievement : be able to make some include files in serverscripts files : I have it updated so this in the header of your serverscript file will make the trick : &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;eval(function (_files){
    var root = &quot;C:/inetpub/wwwroot/efficy/&quot; + ((typeof(Request) !== &quot;undefined&quot;)? Request.CustomBaseURL: &quot;../customs/Test/&quot;);
    var result = &quot;&quot;;
    for (var i=0; i&amp;lt;_files.length; i++) result += (StrLoadBinaryFile(root + _files[i])) + &quot;\r\n&quot;;
    return result;
}([
    &quot;serverscripts/NL_server_tools.js&quot;
    ,&quot;serverscripts/NL_server.js&quot;
    ,&quot;serverscripts/json2.js&quot;
]));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;in this example I chose to regroup all Efficy specific functions in NL&lt;em&gt;server.js&lt;br&gt;
and all the pure javascripts tools as the splice polyfill in NL&lt;/em&gt;server_tools.js&lt;br&gt;
libjson is the copy of the standard libjson library used sometimes in some scripts. (JSON.parse and stringify)&lt;/p&gt;

&lt;p&gt;Cheers. feel free to improve this code or ask for all the librairies if you need it &lt;br&gt;
please share your code afterward.&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2924/get-the-result-of-a-select-statement-to-an-array-of-object</guid>
<pubDate>Fri, 09 Feb 2018 14:36:11 +0000</pubDate>
</item>
<item>
<title>How can I use CopyDetails2 to copy all fields of a relation?</title>
<link>https://overflow.efficy.io/?qa=2764/how-can-i-use-copydetails2-to-copy-all-fields-of-a-relation</link>
<description>&lt;p&gt;As a follow up of my other question: &lt;a rel=&quot;nofollow&quot; href=&quot;https://overflow.efficy.com/?qa=2741/how-to-automatically-add-serie-products-linked-to-document&quot;&gt;https://overflow.efficy.com/?qa=2741/how-to-automatically-add-serie-products-linked-to-document&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I used CopyDetails2 in my serverscript to copy the linked products from one document 'template' to another document. The copy is coming from an existing template document with PRODUCTS, PRICES and QUANTITIES.The only problem I've got now is to also copy the column QUANTITY. Now it only copy's the standard settings for every product. &lt;/p&gt;

&lt;p&gt;So I've got 2 questions now:&lt;br&gt;
1. How can I succesfully copy all details from the template, including the QUANTITY, PRICE  and K&lt;em&gt;SORT?&lt;br&gt;
2. Is it a problem that K&lt;/em&gt;RELATION in DOCU&lt;em&gt;PROD is used more than once, as long as the K&lt;/em&gt;DOCUMENT and K_PRODUCT is different?&lt;/p&gt;

&lt;p&gt;Would be perfect if there is a solution for this. Thanks for your help!&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Database.CopyDetails2(editHandle, 31, templateKey, [ntProd], false, false);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;My Complete code in editCmd.js&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function docuAddProducts() {
    $.ajax({
        //deze regel gaat er nog vanuit dat de VM wordt gevulv vanuit een opportunity. Zo aanpassen dat dit flexibel wordt, ook voor projecten.
        url: format(&quot;dialog?_macrofile=MacroAjax&amp;amp;_macro=RunScript&amp;amp;file=Winkelwagentje;libjson&amp;amp;func=docuAddProducts&amp;amp;editHandle={editHandle}&quot;),
        type: &quot;GET&quot;,
        success: function (html, textStatus, jqXHR) {
            if (IsNotEfficyErrorHtml(html, function(errorMsg) {alert(errorMsg)})) {
                CebPerform(&quot;CEB_STATE&quot;);
            }
        }
    });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And my complete code in the serverscript&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function docuAddProducts() { 
var editHandle = StrToFloatDef(Request.Argument(&quot;editHandle&quot;), 0);
var Oppo = Database.GetMainDetail(editHandle, ntOppo);
var Proj = Database.GetMainDetail(editHandle, ntProj);
var dienst = 0

if (Oppo != 0){ 
    var oppoContext = Database.OpenConsultContext(ntOppo);
    var oppoDS = Database.Consult(oppoContext, Oppo, true);
    var dienst = oppoDS.FieldByName('F_DIENST').AsString;
    docuProdCopyDetails (dienst);
    Database.CloseContext(oppoContext);
    return;
}

if (Proj !=0){
    var projContext = Database.OpenConsultContext(ntProj);
    var projDS = Database.Consult(projContext, Proj, true);
    var dienst = projDS.FieldByName('F_DIENST').AsString;
    docuProdCopyDetails (dienst);
    Database.CloseContext(projContext);
    return;

}

function docuProdCopyDetails(dienst){
    var SQL = &quot;select K_DOCU_TEMPLATE from LK_OPPO_DIENST where K_OPPO_DIENST = :Param1&quot;; //per dienst wordt 1 VM aangewezen als template
    var tempContext = Database.OpenTemporaryContext();
    var tempDS = Database.ExecuteSystemSQLQuery(0, tempContext, SQL, dienst, true, true, 0);
    var templateKey = tempDS.FieldByName('K_DOCU_TEMPLATE').Value; //templateKey = de k_document van de template VM met het winkelwagentje per dienst
    if (templateKey &amp;gt; 0) {
        try {
            Database.CopyDetails2(editHandle, 31, templateKey, [ntProd], false, false); //31 = Documents
        }
        catch (error) {
        }               
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;}&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2764/how-can-i-use-copydetails2-to-copy-all-fields-of-a-relation</guid>
<pubDate>Thu, 23 Nov 2017 10:25:59 +0000</pubDate>
</item>
<item>
<title>How to automatically add a serie of products linked to a document?</title>
<link>https://overflow.efficy.io/?qa=2741/how-to-automatically-add-serie-of-products-linked-document</link>
<description>&lt;p&gt;See screenshot below. I would like to use a button which triggers a serie (&amp;gt;1) of products automatically linked to the document. The serie of products to be loaded depends on the linked project and is based on the type of project. This last part is less important, my main question is how to realize the first part: how to add multiple products to the document.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=5491577173252996204&quot; alt=&quot;How to automatically add products here&quot;&gt;&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2741/how-to-automatically-add-serie-of-products-linked-document</guid>
<pubDate>Fri, 03 Nov 2017 12:53:38 +0000</pubDate>
</item>
<item>
<title>ZeosSession.Rollback: No Active Transaction</title>
<link>https://overflow.efficy.io/?qa=2568/zeossession-rollback-no-active-transaction</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I have an issue with the following code on an Efficy 10 R7987 : &lt;/p&gt;

&lt;p&gt;Database.SendExternalMail(sendFrom, emailInterCom, emailDirector, subject, body, &lt;strong&gt;ntOppo, oppoKey, 'U'&lt;/strong&gt;);&lt;/p&gt;

&lt;p&gt;when it is executed I get the following error Message: &lt;em&gt;&quot;ZeosSession.Rollback: No Active Transaction&lt;/em&gt; &lt;img src=&quot;https://overflow.efficy.com/?qa=blob&amp;amp;qa_blobid=18221185059637508915&quot; alt=&quot;enter image description here&quot;&gt;&lt;/p&gt;

&lt;p&gt;if I change it by : &lt;br&gt;
Database.SendExternalMail(sendFrom, emailInterCom, emailDirector, subject, body, &lt;strong&gt;ntNone, 0&lt;/strong&gt;);&lt;/p&gt;

&lt;p&gt;I don't have the error message.&lt;/p&gt;

&lt;p&gt;this serverscript is called from the consult of the Opportunity, so the opportunity already exists ... I just want to save the External mail into Efficy ...&lt;/p&gt;

&lt;p&gt;Do any body have any idea ? &lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=2568/zeossession-rollback-no-active-transaction</guid>
<pubDate>Fri, 16 Jun 2017 15:04:26 +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>Amount converted to written text</title>
<link>https://overflow.efficy.io/?qa=1535/amount-converted-to-written-text</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;for a customer I need a function to have an amount converted to a written text.&lt;br&gt;
For example:&lt;br&gt;
amount: 1.000&lt;br&gt;
written text: one Thousand&lt;/p&gt;

&lt;p&gt;Does anyone has this kind of conversion script for me that I can use?&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;
Jeroen Floor&lt;/p&gt;
</description>
<category>WorkFlow / Serverscript</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=1535/amount-converted-to-written-text</guid>
<pubDate>Wed, 20 Apr 2016 09:38:38 +0000</pubDate>
</item>
<item>
<title>Usage of client filter in serverside script</title>
<link>https://overflow.efficy.io/?qa=1092/usage-of-client-filter-in-serverside-script</link>
<description>&lt;p&gt;Dear,&lt;/p&gt;

&lt;p&gt;I need to use the filter entered by a user in a serverside script.&lt;br&gt;
The serverscript = ProcessRecords.js&lt;br&gt;
The function used: GetDataSetFromQuery&lt;/p&gt;

&lt;p&gt;To pass the filter from client to server following tag is used: var Filter = &quot;&amp;lt;%GetGridFilter(type=RAW)%&amp;gt;&quot;;&lt;/p&gt;

&lt;p&gt;This allways gives an empty filter.&lt;br&gt;
I replace it with: &lt;br&gt;
var elemFilter = document.getElementsByName('FTEXT');&lt;br&gt;
if (elemFilter) var Filter = elemFilter.FTEXT.value;&lt;/p&gt;

&lt;p&gt;This then gives me an error saying:&lt;br&gt;
The query results are no longer available. Please refresh the original page!&lt;/p&gt;

&lt;p&gt;Did someone used this filter already successfully?&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=1092/usage-of-client-filter-in-serverside-script</guid>
<pubDate>Mon, 04 Jan 2016 14:21:34 +0000</pubDate>
</item>
</channel>
</rss>