Показать сообщение отдельно
Старый 02.09.2009, 16:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Everything AX: Using the .NET Business Connector from PowerShell
Источник: http://www.crankturner.com/2008/12/u...ctor-from.html
==============

Ok, we've made the big jump to Dynamics AX 2009! Wow, lots of work going all of the way from Axapta 3.0

One of the hurdles was dealing with the COM connector. This is no small undertaking - the COM interface has CHANGED! It was time to upgrade to the .NET business connector. After installing the .NET client dll, we are now able to connect to our servers using the .NET Business Connector. Here is an example in PowerShell.

view plaincopy to clipboardprint?
  1. # load the .dll (similar to the c# "Using" statement)  
  2. [reflection.Assembly]::Loadfile("C:\Program Files\Microsoft Dynamics AX\50\Client\Bin\Microsoft.Dynamics.BusinessConnectorNet.dll")   </span>
  3. $ax = new-object Microsoft.Dynamics.BusinessConnectorNet.Axapta  
  4.  
  5. # Look at the properties   </span>
  6. # More info at: http://msdn.microsoft.com/en-us/library/aa626373.aspx   </span>
  7. # $ax | get-member  
  8.  
  9. $ax.logon("","","","")   </span>
  10. $o = $ax.CallStaticClassMethod("SysLabel","labelId2String2","@SYS21669" )    </span>
  11. $o # Should be "ABC"  </span>
  12.  
  13. # Look at some session info   </span>
  14. $xSession = $ax.CreateAxaptaObject("XSession")   </span>
  15. $xSession.call("AOSName")   </span>
  16.  
  17. $xApplication = $ax.CreateAxaptaObject("XApplication")   </span>
  18. $xApplication.call("buildNo")   </span>
  19.  
  20. $ax.CallStaticClassMethod("Session", "isBusinessConnector")     </span>
  21. $ax.CallStaticClassMethod("Session", "getAOSInstance")     </span>
  22. $ax.CallStaticClassMethod("Session", "getAOSPort")   </span>
  23.  
  24. $ax.logoff() 
Merry Christmas to all!
...Greg

@import url("http://greg.graham.googlepages.com/syntaxHighlighter.css");


Источник: http://www.crankturner.com/2008/12/u...ctor-from.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.