Thanks for your assistance Martin and FH-Inway,
I've been battling this all day and I've managed to finally find a solution that works. I use the InventSite.getLocationFromRole() to return the logistics location of the site. However, I found that the logisticslocation table is setup so that the contact details are actually child records of the site location that is returned from that method. To look up the individual locators for a site I used the following where _parentRecID is the location.recID returned by getLocationFromRole(). The _type is whatever LogisticsElectronicAddressMethodType type you are looking for.
LogisticsElectronicAddress logisticsElectronicAddress;
LogisticsLocation logisticsLocation;
if (_parentRecID )
{
select logisticsLocation
where logisticsLocation.ParentLocation == _parentRecID
join logisticsElectronicAddress
where logisticsElectronicAddress.Type == _type &&
logisticsElectronicAddress.location == logisticsLocation.RecId;
}
return logisticsElectronicAddress.Locator;
I did also add in some time verification to the second where clause as follows to make sure the report picks up the details that were relavant at the time of quotaion, however the custQuotationJour.createdDateTime field seems to be blank so this wasn't working. If any one can suggest why that would help me finish this off.
The additional selects were
(logisticsElectronicAddress.ValidTo > _transDateTime || logisticsElectronicAddress.ValidTo == DateTimeUtil::maxValue()) &&
//logisticsElectronicAddress.ValidFrom < _transDateTime
Thanks
David