static void Vend_CustEmailAddressUsingPurpose(Args _args)
{
VendTable vendTable; //if you need customer you can change CustTable.
DirPartyLocation dirPartyLocation;
LogisticsElectronicAddress logisticsElectronicAddress;
LogisticsElectronicAddressRole logisticsElectronicAddressRole;
LogisticsLocationRole logisticsLocationRole;
select firstOnly vendTable
where vendTable.AccountNum == 'US-105';
while select dirPartyLocation
where dirPartyLocation.party == vendTable.Party
{
while select logisticsElectronicAddress
where logisticsElectronicAddress.Location == dirPartyLocation.Location
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email
{
while select logisticsElectronicAddressRole
where logisticsElectronicAddressRole.ElectronicAddress == logisticsElectronicAddress.RecId
join logisticsLocationRole
where logisticsLocationRole.RecId == logisticsElectronicAddressRole.LocationRole
&& logisticsLocationRole.Name == strFmt("%1",logisticsLocationRoleType::Business)
{
info(strFmt("%1 - %2", logisticsElectronicAddress.Locator, logisticsLocationRole.Name));
}
}
}
}
output:
{
VendTable vendTable; //if you need customer you can change CustTable.
DirPartyLocation dirPartyLocation;
LogisticsElectronicAddress logisticsElectronicAddress;
LogisticsElectronicAddressRole logisticsElectronicAddressRole;
LogisticsLocationRole logisticsLocationRole;
select firstOnly vendTable
where vendTable.AccountNum == 'US-105';
while select dirPartyLocation
where dirPartyLocation.party == vendTable.Party
{
while select logisticsElectronicAddress
where logisticsElectronicAddress.Location == dirPartyLocation.Location
&& logisticsElectronicAddress.Type == LogisticsElectronicAddressMethodType::Email
{
while select logisticsElectronicAddressRole
where logisticsElectronicAddressRole.ElectronicAddress == logisticsElectronicAddress.RecId
join logisticsLocationRole
where logisticsLocationRole.RecId == logisticsElectronicAddressRole.LocationRole
&& logisticsLocationRole.Name == strFmt("%1",logisticsLocationRoleType::Business)
{
info(strFmt("%1 - %2", logisticsElectronicAddress.Locator, logisticsLocationRole.Name));
}
}
}
}
output:
No comments:
Post a Comment