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. }

Query inventario a fecha

  1. static void TIDF_getInventPhysicalbyDate(Args _args)
  2. {
  3.     InventDimParm inventDimParmCrit;
  4.     InventSumDateDim inventSumDateDim;
  5.     InventDim inventDim = InventDim::find('AllBlank');
  6.     InventQty inventQty;
  7.     ;
  8.  
  9.     // Set the dimensions
  10.     inventDimParmCrit.initFromInventDim(inventDim);
  11.     inventSumDateDim = inventSumDateDim::newParameters(today(), '010410003', inventDim, inventDimParmCrit);
  12.     inventQty =  inventSumDateDim.receivedQty()-InventSumDateDim.deductedQty()+InventSumDateDim.postedQty();
  13.  
  14.     info(strFmt("%1",inventQty));
  15. }

Test DataProvider de SSRS

  1. static void Job3(Args _args)
  2. {
  3. 	TmpABC tempTable;
  4. 	InventABCDP dataProvider = new InventABCDP();
  5. 	InventABCContract contract = new InventABCContract();
  6. 	contract.parmABCModel(ABCModel::Link);
  7. 	contract.parmCategoryA(10);
  8. 	contract.parmCategoryC(20);
  9. 	contract.parmCategoryB(70);
  10. 	contract.parmInterest(2.5);
  11.  
  12. 	dataProvider.parmDataContract(contract);
  13. 	dataProvider.processReport();
  14. 	tempTable = dataProvider.getTmpABC();
  15.  
  16. 	while select tempTable
  17. 	{
  18. 		info(tempTable.ItemName);
  19. 	}
  20. }