AnsweredAssumed Answered

Silent:true blocks updates to fields

Question asked by Kenneth Brill on Jul 27, 2017
Latest reply on Aug 24, 2017 by Francesca Shiekh

So for the code

 

                if (shipTo == "Partner") {
                    url = app.api.buildURL('Accounts/' + partnerID);
                    var call = app.api.call('read', url, null, {
                        success: _.bind(function (data) {
                            this.model.set('shipping_address_street_c', data.primary_address_street_c, {silent: true});
                            this.model.set('shipping_address_city_c', data.primary_address_city_c, {silent: true});
                            this.model.set('shipping_address_state_c', data.primary_address_state_c, {silent: true});
                            this.model.set('shipping_address_postal_code_c', data.primary_address_postalcode_c, {silent: true});
                            this.model.set('business_name_c', data.name, {silent: true});
                        }, this)
                    });
                } else if (shipTo == "Location") {
                    url = app.api.buildURL('IN_Locations/' + locationID);
                    var call = app.api.call('read', url, null, {
                        success: _.bind(function (data) {
                            this.model.set('shipping_address_street_c', data.address + ' ' + data.address_2, {silent: true});
                            this.model.set('shipping_address_city_c', data.address_city, {silent: true});
                            this.model.set('shipping_address_state_c', data.address_state, {silent: true});
                            this.model.set('shipping_address_postal_code_c', data.address_zip, {silent: true});
                            this.model.set('business_name_c', data.name, {silent: true});
                        }, this)
                    });
                }
                app.alert.dismiss('ship-to-progress');

I want the code to update the address fields WITHOUT setting off the onChange trigger.  But if I include the "{silent: true}" it runs but it DOES NOT update the field. Without it the field is updated...

What am I doing wrong?

Outcomes