(function(){u8.Crm.LinkedUidComponent=function(i){$.extend(this,u8.Crm.LinkedUidComponent.defaults,i);this.bind(i);this._updateLinkedUid()};u8.Crm.LinkedUidComponent.makeClass({name:"LinkedUidComponent",events:["PropertyChange"]});u8.Crm.LinkedUidComponent.defaults={};$.extend(u8.Crm.LinkedUidComponent.prototype,{getUid:function(){return this.uid},setUid:function(i){if(u8.equalsRecordUid(this.uid,i)){return}this.uid=i;this.raise("PropertyChange",{propertyName:"uid",value:i});this._updateLinkedUid()},getLinkedUid:function(){return this.linkedUid},setLinkedUid:function(i){if(u8.equalsRecordUid(this.linkedUid,i)){return}this.linkedUid=i;this.raise("PropertyChange",{propertyName:"linkedUid",value:i})},_updateLinkedUid:function(){var i=this.uid;if(!u8.isValidRecordUid(i)){return this.setLinkedUid(null)}if(!this.linkName){return this.setLinkedUid(i)}var e=this;u8.services.crud.readLink({uid:i,linkName:this.linkName},function(i,n){e.setLinkedUid(n.uid||null)})}})})();