martes, 23 de abril de 2013

Error Install AXModel


Install-AXModel : The pipeline has been stopped.
At line:1 char:16
+ Install-AXModel <<<<  -File C:\TriModel.axmodel -Conflict Push
    + CategoryInfo          : OperationStopped: (:) [Install-AXModel], Pipelin
   eStoppedException
    + FullyQualifiedErrorId : The model file references an element that belong
   s to another model that
does not exists in the model store. You can use the /createparents
    command switch to create a model where these elements will be placed.,Micr
   osoft.Dynamics.AX.Framework.Tools.ModelManagement.PowerShell.InstallAXMode
  lCommand





Resolution:  This problem comes because of conflict in model import, refer to TechNet topic How to: Export and Import a Model [AX 2012] or use the -Conflict Push option at the end of the command to import model file.

Below is full command in case of above error to import model file: 

PS C:\Windows\system32> Install-AXModel -File C:\TriModel.axmodel -createparents
 -Conflict Push



lunes, 22 de abril de 2013

Export-AXModel

Comando para exportar un modelo desde AX 2012




PS C:\> Export-AXModel -model "TRI Model" -File C:\Users\jperez\Desktop\TriModel
042213.axmodel

Model file C:\Users\jperez\Desktop\TriModel042213.axmodel successfully exported
 from model 'TRI MODEL (TRI MODEL)'.













jueves, 18 de abril de 2013

Como recorrer un DataSource Dynamics ax 2012?

public Amount valAmounLine(  )
{
    //Este metodo regresa un monto de una serie de lineas recorriendo directamente el DS.
    FormDataSource      form_ds;
    Common              common;
    ;

    AJMUDLine.write();

    form_ds = AJMUDLine_ds;//DataSource del formulario

    amountLine = 0;

    for ( common = form_ds.getFirst(); common ; common = form_ds.getNext() )
    {
        sumAJMUDLine = common;

        if ( !sumAJMUDLine.Amount )
        {
            amountLine += LinesGrid_Amount.realValue();
        }
        else if( LinesGrid_Amount.realValue() )
        {
            if ( sumAJMUDLine.Amount != LinesGrid_Amount.realValue() )
            {
                 amountLine += LinesGrid_Amount.realValue();
            }
            else
            {
                amountLine += sumAJMUDLine.Amount;
            }
        }
        else
        {
            amountLine += sumAJMUDLine.Amount;
        }
    }
    return amountLine;
}