<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Micro blog dynamics AX &#187; .NET</title>
	<atom:link href="http://ax.nom.es/category/net/feed" rel="self" type="application/rss+xml" />
	<link>http://ax.nom.es</link>
	<description>WordPress weblog</description>
	<lastBuildDate>Fri, 20 Jan 2012 09:14:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Varios ejemplos C# .net para conectar con AX 4.0  utilizando Bussines conector</title>
		<link>http://ax.nom.es/uncategorized/varios-ejemplos-c-net-para-conectar-con-ax-4-0-utilizando-bussines-conector</link>
		<comments>http://ax.nom.es/uncategorized/varios-ejemplos-c-net-para-conectar-con-ax-4-0-utilizando-bussines-conector#comments</comments>
		<pubDate>Thu, 24 Jun 2010 09:20:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[axapta]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ax.nom.es/?p=88</guid>
		<description><![CDATA[UAN using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx; DynAx =3D new = Microsoft.Dynamics.BusinessConnectorNet.Axapta(); // Test the connection to the .NET Business Connector=20 // by using the proxy user. System.Net.NetworkCredential nc =3D new = System.Net.NetworkCredential("proxyBCAX", "********"); try { DynAx.LogonAs("proxyBCAX", "", nc, "", [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UAN</strong></p>
<pre>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
            DynAx =3D new =
Microsoft.Dynamics.BusinessConnectorNet.Axapta();
            // Test the connection to the .NET Business Connector=20
            // by using the proxy user.
            System.Net.NetworkCredential nc =3D new =
            System.Net.NetworkCredential("proxyBCAX", "********");
            try
            {
                DynAx.LogonAs("proxyBCAX", "", nc, "", "", "", =
                   "C:\\Documents and Settings\\1314\\Escritorio\\BC.AXC");
                //DynAx.LogonAs(Environment.UserName, "", null, "", "", =
                 "", "C:\\Documents and Settings\\1314\\Escritorio\\BC.AXC");
                Console.WriteLine( "Success Login OK");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
        }
    }
}

<strong>CHU</strong>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                label1.Text = "";

                Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx = new
                    Microsoft.Dynamics.BusinessConnectorNet.Axapta();
                Microsoft.Dynamics.BusinessConnectorNet.AxaptaRecord DynRec;

                // Authenticate the user and establish a session.
                DynAx.Logon(Company.Text, null, AOS.Text, Configuration.Text);
                if (DynAx != null)
                {
                    label1.Text = ("Login OK");
                }

                // Define the record as the AddressState table.
                DynRec = DynAx.CreateAxaptaRecord("AddressState");

                // Define the query that will run on the AddressState records.
                // This will return all the data in the AddressState table with
                // the cursor positioned at the first record in the table.
                DynRec.ExecuteStmt("select * from %1");

                // Check if the query returned any data.
                if (DynRec.Found)
                {
                    // Display the record on the form that was retrieved from the query.
                    textBox1.Text = (string)DynRec.get_Field("Name");

                }
            }
            catch (Exception ex)
            {
                textBox1.Text = (ex.ToString());
                textBox1.Text += (ex.Message);
                label1.Text = ("Login Filed");
            }
        }
    }
}
<strong>ZRI</strong>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

                label1.Text = "";

                Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx = new
                    Microsoft.Dynamics.BusinessConnectorNet.Axapta();
                Microsoft.Dynamics.BusinessConnectorNet.AxaptaRecord DynRec;

            // Authenticate the user and establish a session.
                System.Net.NetworkCredential nc = new System.Net.NetworkCredential(USER.Text, PASS.Text);
            try
            {
                //"C:\\Documents and Settings\\1314\\Escritorio\\BC.AXC"
                DynAx.LogonAs(AXUser.Text, Domain.Text, nc, Company.Text, null, AOS.Text, Configuration.Text);

                if (DynAx != null)
                {
                    label1.Text = ("Login OK");
                }

                // Define the record as the AddressState table.
                DynRec = DynAx.CreateAxaptaRecord("AddressState");

                // Define the query that will run on the AddressState records.
                // This will return all the data in the AddressState table with
                // the cursor positioned at the first record in the table.
                DynRec.ExecuteStmt("select * from %1");

                // Check if the query returned any data.
                if (DynRec.Found)
                {
                    // Display the record on the form that was retrieved from the query.
                    textBox1.Text = (string)DynRec.get_Field("Name");

                }
                //DynAx.Logoff();
            }
            catch (Exception ex)
            {
                textBox1.Text = (ex.ToString());
                textBox1.Text += (ex.Message);
                label1.Text = ("Login Filed");
            }
        }
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ax.nom.es/uncategorized/varios-ejemplos-c-net-para-conectar-con-ax-4-0-utilizando-bussines-conector/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uso de contenedores Con AX Business Connector Net</title>
		<link>http://ax.nom.es/axapta/uso-de-contenedores-con-ax-business-connector-net</link>
		<comments>http://ax.nom.es/axapta/uso-de-contenedores-con-ax-business-connector-net#comments</comments>
		<pubDate>Mon, 02 Feb 2009 15:54:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[axapta]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[dynamics]]></category>
		<category><![CDATA[dynamics2009]]></category>
		<category><![CDATA[x++]]></category>

		<guid isPermaLink="false">http://ax.nom.es/?p=80</guid>
		<description><![CDATA[using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Security.Cryptography; using System.IO; using Microsoft.Dynamics.BusinessConnectorNet; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { Axapta AX; AX = new Axapta(); AX.Logon(&#8220;CNS&#8221;, null, &#8220;DYmanicsAx1:2713&#8243; , null); object[] Parmlist = new object[1]; AxaptaContainer Container = AX.CreateAxaptaContainer(); Container = (AxaptaContainer)AX.CallStaticRecordMethod(&#8220;InventDim&#8221;, &#8220;dimEnabledFieldList&#8221;, 1); Console.WriteLine(BankAccountTable.Call(&#8220;balanceCur&#8221;, Container)); AX.Logoff(); }]]></description>
			<content:encoded><![CDATA[<p>using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Xml;<br />
using System.Security.Cryptography;<br />
using System.IO;<br />
using Microsoft.Dynamics.BusinessConnectorNet;</p>
<p>namespace ConsoleApplication3<br />
{<br />
class Program<br />
{</p>
<p>static void Main(string[] args)<br />
{<br />
Axapta AX;<br />
AX = new Axapta();<br />
AX.Logon(&#8220;CNS&#8221;, null, &#8220;DYmanicsAx1:2713&#8243; , null);<br />
object[] Parmlist = new object[1];</p>
<p>AxaptaContainer Container = AX.CreateAxaptaContainer();<br />
Container = (AxaptaContainer)AX.CallStaticRecordMethod(&#8220;InventDim&#8221;, &#8220;dimEnabledFieldList&#8221;, 1);<br />
Console.WriteLine(BankAccountTable.Call(&#8220;balanceCur&#8221;, Container));</p>
<p>AX.Logoff();<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://ax.nom.es/axapta/uso-de-contenedores-con-ax-business-connector-net/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft.Axapta.BusinessConnector Code Samples</title>
		<link>http://ax.nom.es/axapta/microsoftaxaptabusinessconnector-code-samples</link>
		<comments>http://ax.nom.es/axapta/microsoftaxaptabusinessconnector-code-samples#comments</comments>
		<pubDate>Fri, 23 Jan 2009 13:29:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[axapta]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[x++]]></category>
		<category><![CDATA[aot]]></category>
		<category><![CDATA[froms]]></category>

		<guid isPermaLink="false">http://ax.nom.es/?p=73</guid>
		<description><![CDATA[Delete sample // Execute a query to retrieve an editable record // where the name is MyStateUpdated. axRecord.ExecuteStmt(&#8220;select forupdate * from %1 where %1.Name == &#8216;MyStateUpdated&#8217;&#8221;); // If the record is found then delete the record. if (axRecord.Found) { // Start a transaction that can be committed. ax.TTSBegin(); axRecord.Delete(); // Commit the transaction. ax.TTSCommit(); } [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Delete sample</strong></p>
<p>// Execute a query to retrieve an editable record<br />
// where the name is MyStateUpdated.<br />
axRecord.ExecuteStmt(&#8220;select forupdate * from %1 where %1.Name ==<br />
&#8216;MyStateUpdated&#8217;&#8221;);</p>
<p>// If the record is found then delete the record.<br />
if (axRecord.Found)<br />
{<br />
// Start a transaction that can be committed.<br />
ax.TTSBegin();<br />
axRecord.Delete();<br />
// Commit the transaction.<br />
ax.TTSCommit();<br />
}</p>
<p><strong>INSERT</strong></p>
<p>// Create the .NET Business Connector objects.<br />
Axapta ax;<br />
AxaptaRecord axRecord;<br />
string tableName = &#8220;AddressState&#8221;;</p>
<p>try<br />
{<br />
// Login to Microsoft Dynamics AX.<br />
ax = new Axapta();<br />
ax.Logon(null, null, null, null);</p>
<p>// Create a new AddressState table record.<br />
using (axRecord = ax.CreateAxaptaRecord(tableName));<br />
{</p>
<p>// Provide values for each of the AddressState record fields.<br />
axRecord.set_Field(&#8220;NAME&#8221;, &#8220;MyState&#8221;);<br />
axRecord.set_Field(&#8220;STATEID&#8221;, &#8220;MyState&#8221;);<br />
axRecord.set_Field(&#8220;COUNTRYREGIONID&#8221;, &#8220;US&#8221;);<br />
axRecord.set_Field(&#8220;INTRASTATCODE&#8221;, &#8220;&#8221;);</p>
<p>// Commit the record to the database.<br />
axRecord.Insert();<br />
}<br />
}<br />
catch (Exception e)<br />
{<br />
Console.WriteLine(&#8220;Error encountered: {0}&#8221;, e.Message);<br />
// Take other error action as needed.<br />
}<br />
<strong>READ</strong></p>
<p>// Create the .NET Business Connector objects.<br />
Axapta ax;<br />
AxaptaRecord axRecord;<br />
string tableName = &#8220;AddressState&#8221;;</p>
<p>// The AddressState field names for calls to<br />
// the AxRecord.get_field method.<br />
string strNameField = &#8220;NAME&#8221;;<br />
string strStateIdField = &#8220;STATEID&#8221;;</p>
<p>// The output variables for calls to the<br />
// AxRecord.get_Field method.<br />
object fieldName, fieldStateId;</p>
<p>try<br />
{<br />
// Login to Microsoft Dynamics AX.<br />
ax = new Axapta();<br />
ax.Logon(null, null, null, null);</p>
<p>// Create a query using the AxaptaRecord class<br />
// for the StateAddress table.<br />
using (axRecord = ax.CreateAxaptaRecord(tableName));<br />
{</p>
<p>// Execute the query on the table.<br />
axRecord.ExecuteStmt(&#8220;select * from %1&#8243;);</p>
<p>// Create output with a title and column headings<br />
// for the returned records.<br />
Console.WriteLine(&#8220;List of selected records from {0}&#8221;,<br />
tableName);<br />
Console.WriteLine(&#8220;{0}\t{1}&#8221;, strNameField, strStateIdField);</p>
<p>// Loop through the set of retrieved records.<br />
while (axRecord.Found)<br />
{<br />
// Retrieve the record data for the specified fields.<br />
fieldName = axRecord.get_Field(strNameField);<br />
fieldStateId = axRecord.get_Field(strStateIdField);</p>
<p>// Display the retrieved data.<br />
Console.WriteLine(fieldName + &#8220;\t&#8221; + fieldStateId);</p>
<p>// Advance to the next row.<br />
axRecord.Next();<br />
}<br />
}<br />
}</p>
<p>catch (Exception e)<br />
{<br />
Console.WriteLine(&#8220;Error encountered: {0}&#8221;, e.Message);<br />
// Take other error action as needed.<br />
}</p>
<p><strong>UPDATE</strong></p>
<p>// Create an Axapta record for the StateAddress table.<br />
axRecord = ax.CreateAxaptaRecord(tableName);</p>
<p>// Execute a query to retrieve an editable record where the name is MyState.<br />
axRecord.ExecuteStmt(&#8220;select forupdate * from %1 where %1.Name ==<br />
&#8216;MyState&#8217;&#8221;);</p>
<p>// If the record is found then update the name.<br />
if (axRecord.Found)<br />
{<br />
// Start a transaction that can be committed.<br />
ax.TTSBegin();<br />
axRecord.set_Field(&#8220;Name&#8221;, &#8220;MyStateUpdated&#8221;);<br />
axRecord.Update();</p>
<p>// Commit the transaction.<br />
ax.TTSCommit();<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://ax.nom.es/axapta/microsoftaxaptabusinessconnector-code-samples/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

