Hi,

I am a beginner for CRM and Creatio. I got this code from academy.

I am stuck at UpdateQuery. Is there any other way to set column values from client side?

OwnerId is taken from a lookup of contacts

 var OwnerId = this.openLookup(config, this.addCallBack, this);

         var SelectedRows = this.get("SelectedRows");

                if(SelectedRows.length > 0){

                    var batchQuery = this.Ext.create("Terrasoft.BatchQuery");

                    SelectedRows.forEach(function(selectedRowId){

                    var update = this.Ext.create("UpdateQuery",{

                        rootSchemaName : "Lead"

                        

                    });

                    update.enablePrimaryColumnFilter(selectedRowId);

                    update.setParameterValue("Owner", OwnerId, this.Terrasoft.DataValueType.GUID);

                    batchQuery.add(update);

                    },this);

                    batchQuery.execute(function(){

                        this.reloadGridData();

                    },this);

                }

Like 0

Like

2 comments

The UpdateQuery is used to perform an update on any record or records. If you're wanting to just update column values on the current record for your page, you can simply use:

this.set("UsrMyPropertyName", "My value");

Also, I have an article on getting started that you might find useful: Getting Started with Writing Code for Creatio

Additional articles on developing for Creatio here.

Hope this helps.

Ryan

 

Ryan Farley,

Thanks Ryan 

The Articles are very helpful

Show all comments