Static void WorkerHireAddressUpdate(HCMworker _worker,StreetName _address = "",str _Phone = "",str _email = "") { HcmWorker hcmWorker; DirPersonRecId _dirPersonRecid; DirPartyPostalAddressView addressView; dirPartyContactInfoView contactView; DirParty dirParty; container roles; HcmWorker = _worker; _dirPersonRecid = HcmWorker.Person; roles = [LogisticsLocationRole::findBytype(LogisticsLocationRoleType::Home).RecId]; //create address DirParty = DirParty::constructFromPartyRecId(_dirPersonRecid); if(_address) { //addressView.LocationName //addressView.City = //addressView.State = //addressView.ZipCode = addressView.CountryRegionId = LogisticsAddressCountryRegion::findByISOCode(SysCountryRegionCode::countryInfo(curext())).CountryRegionId; addressView.Street = _address; addressView.IsPrimary = NoYes::Yes; addressView.Party = _dirPersonRecid; DirParty.createOrUpdatePostalAddress(addressView,roles); } //create primary email if(_email) { contactView.clear(); contactView.LocationName = 'Primary Email'; contactView.Locator = _email; contactView.Type = LogisticsElectronicAddressMethodType::Email; contactView.Party = _dirPersonRecid; contactView.IsPrimary = NoYes::Yes; dirParty.createOrUpdateContactInfo(contactView); } //create primary phone if(_Phone) { contactView.clear(); contactView.LocationName = 'Primary Phone'; contactView.Locator = _Phone; contactView.Type = LogisticsElectronicAddressMethodType::Phone; contactView.Party = _dirPersonRecid; contactView.IsPrimary = NoYes::Yes; dirParty.createOrUpdateContactInfo(contactView); } }