Question

Fetch detail of object on And condition in the esq

Can you check my code on the basis of two I am trying to update the values in esq but not able to do that.

Please let me know how we can do that.

I am not able to update the records on the basis of conditions I put.

    methods: {

        onEntityInitialized : function() {

            this.callParent(arguments);

                this.BudgetValidator();

            },

            BudgetValidator: function() {

             var location=this.get("UsrLocation").displayValue;

             var cat=this.get("UsrServiceCategory").displayValue;

         var esq=this.Ext.create("Terrasoft.EntitySchemaQuery", {

                    rootSchemaName : "UsrBudget"});

                     esq.addColumn("UsrBudgetAmount");

                     esq.addColumn("UsrBudgetCode");

    var esqFirstFilter = esq.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,"UsrCompany.Name",location);

        var esqSecondFilter = esq.createColumnFilterWithParameter(Terrasoft.ComparisonType.EQUAL,

        "UsrServiceCategory.Name",cat);

    esq.filters.logicalOperation = Terrasoft.LogicalOperatorType.AND;

       esq.filters.add("esqFirstFilter",esqFirstFilter);

    esq.filters.add("esqSecondFilter",esqSecondFilter);

               esq.getEntityCollection(function(result){

               if(!result.success){

            this.showInformationDialog("Data query Error");

                  return;

               }

               if (result.collection.getByIndex(0)){

                  

                  this.set("UsrIsBudgetedBudgetAmount",result.collection.getByIndex(0).get("UsrBudgetAmount"));

                    this.set("UsrBudgetCode",result.collection.getByIndex(0).get("UsrBudgetCode"));

                   }

                     else {

                 this.showInformationDialog("0");

                           }

                   },this);

            },

             

Like 0

Like

1 comments

Dear Bhumika,

 

This code works fine on our side. Please contact Creatio support to check why the code is not working on your side - they will be able to help you. 

 

Best regards,

Angela

Show all comments