La api de google nos permite la instalación de forma sencilla de vistosos cuadros de mando.
example AX2009 – Google_charts.rar
http://code.google.com/intl/es-ES/apis/chart/
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, "", "", "", =
"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();
}
}
}
}
CHU
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");
}
}
}
}
ZRI
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");
}
}
}
}
static void AXL_TestSHA1(Args _args)
{
#define.ClrFileStream (‘System.IO.FileStream’)
#define.ClrFileModeEnum (‘System.IO.FileMode’)
#define.ClrFileModeOpen (‘Open’)
#define.ClrFileAccessEnum (‘System.IO.FileAccess’)
#define.ClrFileAccessWrite (‘Write’)
#define.ClrFileAccessRead (‘Read’)//(‘ReadWrite’)
System.IO.FileStream fileStream;
ClrObject fileMode;
ClrObject fileAccess;
str _filename = ‘C:\\Log.txt’;
System.Type typeOfByte;
System.Array arrayOfByte;
int arrayOfByteLength = 1;
int i;
System.Security.Cryptography.SHA1CryptoServiceProvider SHA1;
System.Text.ASCIIEncoding encoding;
str strError;
CLRObject exc;
CLRObject innerExc;
CLRObject clrExcMessage;
int Struct1[];
container cont;
;
try
{
typeOfByte = System.Type::GetType(“System.Byte”);
arrayOfByte = System.Array::CreateInstance( typeOfByte, arrayOfByteLength );
fileMode = CLRInterop::parseClrEnum(#ClrFileModeEnum, #ClrFileModeOpen);
fileAccess = CLRInterop::parseClrEnum(#ClrFileAccessEnum, #ClrFileAccessRead);
SHA1 = new System.Security.Cryptography.SHA1CryptoServiceProvider();
fileStream = new CLRObject(#ClrFileStream, _filename, fileMode, fileAccess);
arrayOfByte = SHA1.ComputeHash(fileStream);
fileStream.Close();
arrayOfByteLength = ClrInterop::getAnyTypeForObject(arrayOfByte.get_Length());
for( i = 0; i < arrayOfByteLength; ++i )
{
cont = conins(cont,i+1,(ClrInterop::getAnyTypeForObject( arrayOfByte.GetValue( i ) )));
print int2hex(ClrInterop::getAnyTypeForObject( arrayOfByte.GetValue( i ) ));
}
}
catch( Exception::Internal )
{
// BP Deviation Documented
exc = CLRInterop::getLastException();
if( exc )
{
clrExcMessage = exc.get_Message();
// BP Deviation Documented
strError = CLRInterop::getAnyTypeForObject( clrExcMessage );
throw error(strError);
}
}
catch( Exception::CLRError )
{
// BP Deviation Documented
exc = CLRInterop::getLastException();
if( exc )
{
clrExcMessage = exc.get_Message();
innerExc = exc.get_InnerException();
while(innerExc != null)
{
clrExcMessage = innerExc.get_Message();
innerExc = innerExc.get_InnerException();
}
// BP Deviation Documented
strError = CLRInterop::getAnyTypeForObject( clrExcMessage );
throw error(strError);
}
}
pause;
}
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(“CNS”, null, “DYmanicsAx1:2713″ , null);
object[] Parmlist = new object[1];
AxaptaContainer Container = AX.CreateAxaptaContainer();
Container = (AxaptaContainer)AX.CallStaticRecordMethod(“InventDim”, “dimEnabledFieldList”, 1);
Console.WriteLine(BankAccountTable.Call(“balanceCur”, Container));
AX.Logoff();
}
Delete sample
// Execute a query to retrieve an editable record
// where the name is MyStateUpdated.
axRecord.ExecuteStmt(“select forupdate * from %1 where %1.Name ==
‘MyStateUpdated’”);
// 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();
}
INSERT
// Create the .NET Business Connector objects.
Axapta ax;
AxaptaRecord axRecord;
string tableName = “AddressState”;
try
{
// Login to Microsoft Dynamics AX.
ax = new Axapta();
ax.Logon(null, null, null, null);
// Create a new AddressState table record.
using (axRecord = ax.CreateAxaptaRecord(tableName));
{
// Provide values for each of the AddressState record fields.
axRecord.set_Field(“NAME”, “MyState”);
axRecord.set_Field(“STATEID”, “MyState”);
axRecord.set_Field(“COUNTRYREGIONID”, “US”);
axRecord.set_Field(“INTRASTATCODE”, “”);
// Commit the record to the database.
axRecord.Insert();
}
}
catch (Exception e)
{
Console.WriteLine(“Error encountered: {0}”, e.Message);
// Take other error action as needed.
}
READ
// Create the .NET Business Connector objects.
Axapta ax;
AxaptaRecord axRecord;
string tableName = “AddressState”;
// The AddressState field names for calls to
// the AxRecord.get_field method.
string strNameField = “NAME”;
string strStateIdField = “STATEID”;
// The output variables for calls to the
// AxRecord.get_Field method.
object fieldName, fieldStateId;
try
{
// Login to Microsoft Dynamics AX.
ax = new Axapta();
ax.Logon(null, null, null, null);
// Create a query using the AxaptaRecord class
// for the StateAddress table.
using (axRecord = ax.CreateAxaptaRecord(tableName));
{
// Execute the query on the table.
axRecord.ExecuteStmt(“select * from %1″);
// Create output with a title and column headings
// for the returned records.
Console.WriteLine(“List of selected records from {0}”,
tableName);
Console.WriteLine(“{0}\t{1}”, strNameField, strStateIdField);
// Loop through the set of retrieved records.
while (axRecord.Found)
{
// Retrieve the record data for the specified fields.
fieldName = axRecord.get_Field(strNameField);
fieldStateId = axRecord.get_Field(strStateIdField);
// Display the retrieved data.
Console.WriteLine(fieldName + “\t” + fieldStateId);
// Advance to the next row.
axRecord.Next();
}
}
}
catch (Exception e)
{
Console.WriteLine(“Error encountered: {0}”, e.Message);
// Take other error action as needed.
}
UPDATE
// Create an Axapta record for the StateAddress table.
axRecord = ax.CreateAxaptaRecord(tableName);
// Execute a query to retrieve an editable record where the name is MyState.
axRecord.ExecuteStmt(“select forupdate * from %1 where %1.Name ==
‘MyState’”);
// If the record is found then update the name.
if (axRecord.Found)
{
// Start a transaction that can be committed.
ax.TTSBegin();
axRecord.set_Field(“Name”, “MyStateUpdated”);
axRecord.Update();
// Commit the transaction.
ax.TTSCommit();
}
Guía rápida de instalación ax2009. Sobre W2003 R2 y SQL2005
Instalación del servidor Windows 2003.
Instalación de SQL server 2005
Instalar Aplication Role
Al ejecutar el instalador nos cargara los prerrequisitos automáticamente.
Necesario permisos de Administrador.
Crear base de datos para AX 2009.
Para ello el usuario(login) debe ser miembro del grupo “dbcreator“ en SQL server.
Instalar el AOS Role.
Dar permios al usuario(login) que instala AOS dentro de la base de datos como securityadmin.
Comprobar tras la instalación que se crea el inicio de sesión para el AOS “domain\host$” con los permisos “db_datareader”, “db_datawriter”, “db_ddladmin”, “public” sobre la BBDD.
Validar permisos de ejecución para el inicio de sesión del usuario de AOS (“domain\host$”) y las credenciales que arranque del servicio de AOS para los procedimientos almacenados, “CREATESERVERSESSIONS”, “CREATEUSERSESIONS”
Instalar Client Role.
Necesario permisos de Administrador.
Al iniciar sesión se crean los perfiles ,“Admin “y “guest” en la “userinfo” .
Instalar .NET bussines conector.
User: AXDOS\ProxyAX .
pass: Axapta20.
Instalar Role center and Enterprise Portal.
Necesario permisos de Administrador.
Requisitos previos:
- Crear la cuenta bussines conector en el dominio.
- Instalar el framework 3.5 básico sin SP
- Crear un grupo de aplicaciones en IIS y asignarle el usuario para Bussines conector.
- Crear un directorio virtual y asignarle la aplicación anterior.
- ASP .NET 2.0.
- Microsoft SQL Server 2005 ADOMD.Net
- Microsoft Windows SharePoint Service 3.0 SP1
Estos se instalan de forma automática con desde el instaler de AX2009.
Es necesario descargar de la pagina de Microsoft Sharepoint sp1.
http://www.microsoft.com/downloads/details.aspx?familyid=EF93E453-75F1-45DF-8C6F-4565E8549C2A&displaylang=en
Durante la instalación puede aparecer el siguiente error:
Error executing code: SysDevelopmentProxy (object) has no valid runable code in method ‘generate’.
(C)\Classes\SysDevelopmentProxy\generate
(C)\Classes\SysEPDeployment\clrGenerateProxies – line 7
(C)\Classes\SysEPDeployment\deployProxies
(C)\Classes\SysEPDeployment\deployAllWebParts
(C)\Classes\SysEPDeployment\deployEPOnSharepoint
(C)\Classes\SysEPDeployment\installEnterprisePortal
Microsoft.Dynamics.BusinessConnectorNet.BusinessConnectorException
at Microsoft.Dynamics.BusinessConnectorNet.AxaptaObject.Call(String methodName, Object[] paramList)
at Microsoft.Dynamics.BusinessConnectorNet.AxaptaObject.Call(String methodName, Object param1)
at Microsoft.Dynamics.Framework.BusinessConnector.Session.DynamicsObjectAdapter.Call(String methodName, Object param1)
An error occurred during setup of Role Centers and Enterprise Portal.
Reason: No .NET Business Connector session could be found.
=== Rolling back setup of Role Centers and Enterprise Portal due to error =
Este es provocado por un error en la referencia al conector, al compilar la aplicación sin haber instalado el “bussines conector”.
Puede aparecer este error el desplegar las áreas de negocio.
Ha ocurrido un error inesperado.
A ProgressTemplate must be specified on UpdateProgress control with ID ‘AxProgressControl’.
System.InvalidOperationException
at System.Web.UI.UpdateProgress.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.UpdateProgress.get_Controls()
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxProgressControl.Create()
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxProgressControl.AddToPage(Control control)
at Microsoft.Dynamics.Framework.Portal.UI.WebControls.AxContentPanel.Page_PreLoad(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Page.OnPreLoad(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Este error es debido a la instalación del SP1 sobre el framework 3.5. El Share point y Dynamics no admiten este parche.
Ahora q esta muy de moda lo del cambio contable por la nueva ley vamos a hacer un entorno de desarrollo.
Nos encontramos en algunos casos que una cambio de Service pack o una actualización grave sobre producción representa una incompatibilidad entre el trabajo de los usuarios y las tareas de desarrollo, sin llegar a exagerar como las instalaciones que hacíamos cuando heramos esclavos de las consultoras y a la “grupy” financiera de turno se le ocurría de debíamos tener el entorno de producción, el de preproducción y el de desarrollo. No es mala idea tener un lugar en el que poder trabajar con libertad tanto para desarrollo como para pruebas funcionales.
Axapta básicamente esta compuesto por un código fuente que se almacena en unos directorios dentro de unos archivos específicos y una base de datos. Todo esto no funciona sin un programa que interprete estos archivos y los enlace con la base de datos.
De esta manera para hacer un entorno de desarrollo a partir de producción solo debemos mantener esta coherencia directorio base de datos.
Ejemplo practico.
Tenemos una instalación tipo, 3.0 spX con una base de datos SQL server X.
Nuestra instalación se encuentra situada en “C:\Navision\Axapta Application\Appl” dentro del directorio tenemos los directorios de las diferentes aplicaciones. Normalmente Standard y producción.
Copiando producción y renombrar el directorio como Test ya tendríamos la mitad de nuestro entorno de desarrollo.
Después solo hay que realizar una copia de seguridad de la base de datos completa y restaurarla con otro nombre.
El último paso seria configurar el cliente o el AOS para que accedan al nuevo entorno y sincronicen los posibles cambios.
La idea de hacer experimentos con gaseosa siempre nos ha llamado la atención debe ser esa parte animal que dentro de nuestros cerebros se resiste a desaparecer y que hace reacción ante cualquier botón o lucecita q se nos ponga delante. Algo parecido nos sucede con las nuevas versiones y los download. Todo es descargar y probar. XDD
A lo que vamos, nos hemos propuesto instalar lo último de lo más en y ello vamos.
Tras descargar la imagen iso de sql Server 2008, le damos setup, este nos recomienda que nos instalemos una serie de parches, la cosa funciona sola y las actualizaciones necesarias se descargan y actualizan sin mucho esfuerzo.
Después llega el momento del siguiente, siguiente, siguiente que tanto nos gusta a los grandes gurus de la informática.
Nos peleamos un poco con los permisos de los servicios y las configuración standrad.
Para reducir esperas le damos a todo como administrador del domino que para eso lo hemos creado, ejjeje y asin no tenemos que pagarle horas extras al externo que nos lo mantiene.
Todo ok. Sql chutando y el AX 2009 prepardo para instalar.
Un poco de lo mismo (Siguiente siguente siguiente..) y ya tenemos la instalación preparada para compilar.
Despues de todo esto, provaremos el rendimiento de sql 2008 y alguna cosilla nueva. .
“Una experiencia nunca es un fracaso, pues siempre viene a demostrar algo”.
Thomas Alva Edison (1847-1931);
PD: Hasta un consultor financiero se podria instalar esto …. XDDDD









