you may get this information as under
CompanyInfo CompanyInfo; CompanyInfo = CompanyInfo::find(); info("Phone: "+CompanyInfo.phone()); info("Fax: "+CompanyInfo.teleFax());
Above code will return you Primary Phone and Fax. In case you wan to get the non-primary as well, you may use code as under. In below example I am getting phone number of HCMWorker which is party. in your case it will be a legal entity which you have to consider as party
LogisticsElectronicAddress logisticsElectronicAddress; HcmWorker HcmWorker; DirPartyLocation dirPartyLocation; DirPartyTable DirPartyTable; int64 RecIdOfParty; ; RecIdOfParty = HcmWorker::findByPersonnelNumber("000670").DirPerson().RecId; select dirPartyTable where dirPartyTable.RecId == RecIdOfParty; select firstOnly Description,Type,Locator,LocatorExtension,IsPrimary,IsPrivate,RecId from logisticsElectronicAddress order by logisticsElectronicAddress.IsPrimary desc join dirPartyLocation where dirPartyLocation.Party == dirPartyTable.RecId && dirPartyLocation.IsPostalAddress == NoYes::No && logisticsElectronicAddress.Location == dirPartyLocation.Location && logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Phone; { info(strFmt("%1 : %2 %3",logisticsElectronicAddress.Description,logisticsElectronicAddress.Locator,logisticsElectronicAddress.LocatorExtension)); }