code: function(foreign_key_field, event_args) {
  
  		var record = event_args.record, // record belongs to this module
  			properties = this._properties_by_guid[record.guid];
  
  		if (properties[this._name] != null) {
  
  			// remove old record from collection
  			this._unregisterRecord(record, properties[this._name]);
  
  		}
  
  		if (properties[this._foreign_key_field_name]) {
  
  			this._registerByReferencedId(record, properties, properties[this._foreign_key_field_name]);
  
  		} else {
  
  			properties[this._name] = null;
  
  		}
  
  		this._fireFieldChangedEvents(record);
  
  	}
docs: Fires, when local record's foreign id field is assigned a new value.
  Example:
  ```javascript
  record.set('category_id', 123); // 'record' is from local module, 123 - id of foreign record
  ```
  @param {Lava.data.field.ForeignKey} foreign_key_field
  @param {Lava.data.field.Abstract#event:changed} event_args