0 votes

Hi all,

With ConsultDetail I get the Documents of an Opportunity, but I want to filter this dataset on quotes : a quote have a REFERENCE that start by 'D'.

The EDN say that TDataSet.Filter is "The text of the current SQL filter for the dataset." so I try to filter my dataset with REFERENCE LIKE 'D%' but Efficy throw me this error :

ID: WKFL-2142
Message: Error while executing Script "OppoConvertToProj" at line 52 char 13.
Message: "L'URI à décoder contient un caractère incorrect"

After some tests I know that the error is thorwn by the % . I tried to fix it in the "CleanFilter" (replace % by %) but I have the same error.

Is it possible to filter a dataset with a like ?

Here is my filter (first recordCount is correct, the second is empty)

// copy links to quote ==> CUSTOM : Create new Document (ORDER)
var OppoDocuDS = Database.ConsultDetail(QueryHandle, OppoContext, OppoKey, ntDocu, true, true, 0);

// filter dataset on quote
var Filter = "REFERENCE LIKE 'D%'";
var CleanFilter = decodeURIComponent(Filter).replace(/=/gi, "=").replace(/</gi, "<").replace(/>/gi, ">").replace(/&#37;/gi, "%")
OppoDocuDS.Filtered = false
if (CleanFilter != "") {
    OppoDocuDS.Filter = CleanFilter
    OppoDocuDS.FilterOptions = 1
    OppoDocuDS.Filtered = true

asked in WorkFlow / Serverscript by (245 points)
edited by

1 Answer

0 votes


An example can be found in standard Efficy. The filter requires indeed some cleanup.

efficy\serverscripts\PublImportFrom.js (line 112, Efficy 11.1)

var CleanFilter = decodeURIComponent(Filter).replace(/&#61;/gi, "=").replace(/&amp;#61;/gi, "=").replace(/&amp;lt;/gi, "<").replace(/&amp;gt;/gi, ">")
answered by (6.8k points)

I know that, in the code I use it, but I don't know how to "cleanup" the %.
I tried with his HTML_ENTITIES but I have the same error

I tried with
var CleanFilter = decodeURIComponent(Filter).replace(/=/gi, "=").replace(/</gi, "<").replace(/>/gi, ">").replace(/&#37;/gi, "%")
1,167 questions
1,425 answers
325 users