setRulesFromSql method not working as expected

HTML:

<ejs-querybuilder width="80%" #constructorConsultas class="row" locale="sigaIdiomas" (created)="setRules2()" (actionBegin)="obtenerComboCampo($event)">
            <e-columns>
              <div *ngFor="let campo of configColumnasDTO.configColumnasQueryBuilderItem; let i = index">          
                <e-column *ngIf="campo.selectayuda == null && campo.tipocampo != 'date'" [field]="campo.idcampo" [label]="campo.nombreenconsulta" [type]="campo.tipocampo" [operators]="customOperators"></e-column>
                <e-column *ngIf="campo.selectayuda == null && campo.tipocampo == 'date'" [field]="campo.idcampo" [label]="campo.nombreenconsulta" [type]="campo.tipocampo" [operators]="customOperators" format="dd/MM/yyyy"></e-column>
                <e-column *ngIf="campo.selectayuda != null" [field]="campo.idcampo" [label]="campo.nombreenconsulta" [type]="campo.tipocampo">
                  <ng-template #ruleTemplate let-data>
                    <div class="e-rule e-rule-template">
                      <div class="e-rule-filter">
                        <ejs-dropdownlist (change)="fieldChange($event)" [fields]="data.fields" [dataSource]="data.columns" [value]="data.rule.field">
                        </ejs-dropdownlist>
                      </div>
                       <div class="e-rule-operator e-operator">
                        <ejs-radiobutton id="{{data.ruleID}}_operator1" label="Es igual" name='{{data.ruleID}}_operator' value='equal' (change)="operatorChange($event)" [checked]="(data.rule.operator == 'equal')"></ejs-radiobutton>
                        <ejs-radiobutton id="{{data.ruleID}}_operator2" label="Distinto" name='{{data.ruleID}}_operator' value='notequal' (change)="operatorChange($event)" [checked]="(data.rule.operator == 'notequal')"></ejs-radiobutton>
                      </div> 
                      <div class="e-rule-value e-value e-custom-value">
                        <ejs-dropdownlist (change)="valueChange($event)" [fields]="fields" [dataSource]="listaCombosObject.get(campo.nombreenconsulta).combooItems" [value]="data.rule.value">
                        </ejs-dropdownlist>
                      </div>
                      <div class="e-rule-value-delete">
                        <button class="e-removerule e-custom-delete e-rule-delete e-css e-btn e-small e-round">
                          <span class="e-btn-icon e-icons e-delete-icon"></span>
                        </button>
                      </div>
                    </div>
                  </ng-template>
                </e-column>
              </div>
            </e-columns>
          </ejs-querybuilder>


TS:

 setRules2(): void{
    if(this.constructorConsultas != undefined){
     /*  this.constructorConsultas.setRules({
          'condition':'and',
          'rules': [{
              "label": "TIPO COLEGIADO",
              "field": "3000",
              "operator": "equal",
              "type": "string",
              "value": "20"
          },
          {
            "label": "RESIDENTE",
            "field": "226",
            "operator": "equal",
            "type": "string",
            "value": "0"
        }
      ]}); */
      this.constructorConsultas.setRulesFromSql("450 = 'hfhg'");
      //this.constructorConsultas.setRulesFromSql("(TaskID = 1 and Status LIKE ('Assigned%')) and (TaskID = 1 and Status LIKE ('Assigned%'))");
      console.log(this.constructorConsultas.getRules());
    }   
  }


- Content of configColumnasDTO.configColumnasQueryBuilderItem:

  1. onfigColumnasQueryBuilderItem: [{tipocampo: "string", idcampo: "226", nombreenconsulta: "RESIDENTE",…},…]


method setRulesFromSql doesnt work with that code however If I do a simple try like this:

div *ngFor="let campo of configColumnasDTO.configColumnasQueryBuilderItem; let i = index">          

                <e-column *ngIf="campo.selectayuda == null && campo.tipocampo != 'date'" field="dni" label="DNI" type="string" [operators]="customOperators"></e-column>

+

 this.constructorConsultas.setRulesFromSql("dni = 'hfhg'");


changing field for dni instead using 450 in field attribute works, why doesnt work using campo.idcampo (450) and yes using dni value?

Besides when I used getSqlFromRules after doing the sql manually he gives me 450 = 'hfhg' but it doest work in setRulesFromSQl.


Thanks.





9 Replies

GK Gayathri KarunaiAnandam Syncfusion Team November 18, 2021 04:05 AM UTC

Hi Alejandro,  
  
We have checked your reported query .We are able to replicate the reported issue. We need to validate more on this. So, we will update further details on 19th November 2021. We appreciate your patience until then.    
   
Regards,              
Gayathri K   



GK Gayathri KarunaiAnandam Syncfusion Team November 19, 2021 02:46 AM UTC

Hi Alejandro, 

Thanks for the patience. 

We have checked your reported query and we can reproduce this issue in our end. We have confirmed this as an issue from our side. We have logged a bug report for this. You can track its status from the below feedback link. The fix will be provided in our patch release which will be scheduled on December 1st,2021. 


We appreciate your patience until then. 

Regards, 
Gayathri K 



AL Alejandro November 19, 2021 07:33 AM UTC

Hi Gayathri, despite I m logged the link shows me access denied.




Regards,

Alejandro.



SP Sangeetha Priya Murugan Syncfusion Team November 22, 2021 10:25 AM UTC

Hi Alejandro,  
 
We have checked your reported issue and we would suggest you to logoff and login with Syncfusion credentials. Or clear your cache and try again once. If still issue persist, please share us screenshot of the issue.   
 
Regards, 
Sangeetha M 



AL Alejandro December 1, 2021 04:22 PM UTC

Hi, Has It been released the needed 1st December patch for solving this issue?



GK Gayathri KarunaiAnandam Syncfusion Team December 3, 2021 03:23 PM UTC

Hi Alejandro,  


We are sorry for the delay. 


We are facing more complexity in fixing this issue. So, we will include this fix in our upcoming patch release which will be scheduled for December 8th,2021 and we appreciate your patience until then. You can track its status from the below feedback link. 


Feedbackhttps://www.syncfusion.com/feedback/30500/when-field-is-set-as-number-setrulesfromsql-is-not-working


We appreciate your patience until then. 

   

Regards,  

Gayathri K  



AL Alejandro December 9, 2021 01:27 PM UTC

Hi, was the patch released? I have tried with v19.3.57 version released 7th December but the problem still persists.


Regards.

Alejandro.



GK Gayathri KarunaiAnandam Syncfusion Team replied to Alejandro December 10, 2021 04:33 AM UTC

Hi Alejandro,   


We are deeply sorry for the delay.  


We need to ensure more test cases for this fix. So, we will include this fix in our Volume 4 main release which will be scheduled for December 17th,2021. You can track its status from the below feedback link.  


Feedbackhttps://www.syncfusion.com/feedback/30500/when-field-is-set-as-number-setrulesfromsql-is-not-working 


We appreciate your patience until then.  

    

Regards,   

Gayathri K   



GK Gayathri KarunaiAnandam Syncfusion Team December 21, 2021 07:00 AM UTC

Hi Alejandro, 

We are glad to announce that our Essential Studio 2021 Volume 4 release v19.4.0.38  is rolled out and is available for download under the following link. 




We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

Regards,           
Gayathri K 


Loader.
Up arrow icon