title: SugarCRM 7 adding PCA Predict - this.model is null on second attempt
body: <p>To give some background, PCA Predict is a service whereby you start typing an address and it will autocomplete with suggestions and fill in the other address fields when you click on the correct address.</p>
  
  <p>I'm having to do some extra work because where the fields get filled out by PCA Predict, it isn't saved to the model (it just exists in the view) (by adding a space character to the field will make it save).</p>
  
  <p>I have it working on the first attempt, but if I navigate to a different module, then come back, model is null and I get an error.</p>
  
  <pre><code>({
       // CustomRecord View (base) 
  extendsFrom: 'AccountsRecordView',
  initialize: function (options) {
      this._super('initialize', [options]);
  
  },
  
  render: function(){
       this._super('render');
  },
  
  
  editClicked: function() {
     this._super('editClicked');
     var self = this; 
     setTimeout(function() {
  
        pca.load();
  
        pca.on("load", function (type, Id, control) {
           control.listen("populate", function (address) {
               self.model.set('shipping_address_city', address.City);
  
               //self.model is null second time round.
  
           });
        });
     }, 2000);
  
  }
  
  })
  </code></pre>
  
  <p>Why is self.model null!?  All the other properties of self is available, all apart from model, which is set to null!</p>
  
  <p><a href="https://i.stack.imgur.com/akjT4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/akjT4.png" alt="Console of self object"></a></p>