Leer Tipo de dirección – AX2012

  1. public static LogisticsPostalAddress getPostalAddressByType(DirPartyRecId _party, LogisticsLocationRoleType _type)
  2.  
  3. {
  4.  
  5.     DirPartyLocation        partyLocation;
  6.  
  7.     DirPartyLocationRole    partyLocationRole;
  8.  
  9.     LogisticsLocation       location;
  10.  
  11.     LogisticsLocationRole   locationRole;
  12.  
  13.     LogisticsPostalAddress  postalAddress;
  14.  
  15.  
  16.     select firstonly postalAddress
  17.  
  18.         exists join location
  19.  
  20.             where location.RecId == postalAddress.Location
  21.  
  22.         exists join locationRole
  23.  
  24.             where locationRole.Type  == _type
  25.  
  26.         exists join partyLocation
  27.  
  28.             where 
  29.  
  30.                 partyLocation.Location == location.RecId &&
  31.  
  32.                 partyLocation.Party == _party
  33.  
  34.         exists join partyLocationRole
  35.  
  36.             where partyLocationRole.PartyLocation == partyLocation.RecId &&
  37.  
  38.                 partyLocationRole.LocationRole == locationRole.RecId;
  39.  
  40.  
  41.     return postalAddress;
  42.  
  43. }

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *