Tag Archives: AX 2012 R3

AX 2012: Error when in SSRS print preview

Error in Microsoft Dynamics AX 2012 Reports Print Preview

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. The InnerException message was ‘Element ‘http://tempuri.org/:queryBuilderArgs’ contains data from a type that maps to the name ‘http://schemas.datacontract.org/2004/07/XppClasses:SrsReportProviderQueryBuilderArgs’. The deserializer has no knowledge of any type that maps to this name. Consider using a DataContractResolver or add the type corresponding to ‘SrsReportProviderQueryBuilderArgs’ to the list of known types – for example, by using the KnownTypeAttribute attribute or by adding it to the list of known types passed to DataContractSerializer.’.  Please see InnerException for more details.

The formatter threw an exception while trying to deserialize the message
Solutions:

Check Inbound Ports in Microsoft Dynamics AX Client.

The formatter threw an exception while trying to deserialize the message - sol

Activate Inbound Ports “BIServices” then try to print reports again.

It also important to activate inbound services as possible.

The formatter threw an exception while trying to deserialize the message - sol 2

 

AX 2012: Post Sales Invoice using X++

AX 2012: Post Sales Invoice using X++

static void postSalesInvoice(Args _args)
{
SalesFormLetter salesFormLetter;
SalesTable salesTable;
SalesId salesId = ‘005063’;
System.Exception error;
str strError;
CustInvoiceJour custInvoiceJour;
;

ttsBegin;
try
{
salesTable = SalesTable::find(salesId);

if (salesTable && salesTable.SalesStatus == SalesStatus::Delivered)
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::All, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No, NoYes::Yes);

if (salesFormLetter.parmJournalRecord().TableId == tableNum(CustInvoiceJour))
{
custInvoiceJour = salesFormLetter.parmJournalRecord();
info(strFmt(‘Sales Order #:%1 has been successfully posted and Invoice #:%2 is created!’, custInvoiceJour.SalesId, custInvoiceJour.InvoiceId));
}

}
else
{
info(strFmt(‘%1 does not exsists or null in the system, please try again!’, salesId));
}

}
catch (Exception::CLRError)
{
error = CLRInterop::getLastException();
strError = error.ToString();

info(strfmt(‘%1’, strError));
info(strFmt(‘%1 failed to post, please try again!’, salesId));
}
ttscommit;
}

AX 2012: Post Packing Slip using X++

AX 2012: Post Packing Slip using X++

static void postPackingSlip(Args _args)
{
SalesFormLetter salesFormLetter;
SalesTable salesTable;
SalesId salesId = ‘SO00001’;
System.Exception error;
str strError;
CustPackingSlipJour custPackingSlipJour;
;

ttsBegin;
try
{
salesTable = SalesTable::find(salesId);

if (salesTable && salesTable.SalesStatus == SalesStatus::Backorder)
{
salesFormLetter = SalesFormLetter::construct(DocumentStatus::PackingSlip);
salesFormLetter.update(salesTable, systemDateGet(), SalesUpdate::PackingSlip, AccountOrder::None, NoYes::No, NoYes::No, NoYes::No);

if (salesFormLetter.parmJournalRecord().TableId == tableNum(custPackingSlipJour))
{
custPackingSlipJour = salesFormLetter.parmJournalRecord();
info(strFmt(‘New Packing Slip #:%1 successfully created for Sales Order #:%2’, custPackingSlipJour.PackingSlipId, custPackingSlipJour.SalesId));
}
}
else
{
info(strFmt(‘%1 does not exsists or null in the system, please try again!’, salesId));
}

}
catch (Exception::CLRError)
{
error = CLRInterop::getLastException();
strError = error.ToString();

info(strfmt(‘%1’, strError));
info(strFmt(‘%1 failed to delivered, please try again!’, salesId));
}
ttscommit;
}

AX 2012 R3: Logon Error, A user session on the server could not be created.

Logon error

A user session on the server could not be created. Try to start the client again. If the problem continues, contact the Microsoft Dynamics AX Administrator.

Warning Details:

This usually caused by Hard-disk failure due to Not Accessible, Out of Memory Spaces or even corrupted drives.

Microsoft Dynamics AX cannot create  a session record in the Databases and you will not be able to open or access Microsoft Dynamics AX Client.

A user session on the server could not be created

 

Solution Details:

  • Check your SQL Server where your Microsoft Dynamics AX Databases was stored.
  • Check if local drives where AX Databases stored are accessible and still enough memory spaces. If full try to clean some temporary log files or try to increase your local drive spaces.

 

Show’s Data(D:) is already full and no enough spaces to create any records.

Before

A user session on the server could not be created (sol)

 

After

A user session on the server could not be created (sol 2)

 

Try again to open Microsoft Dynamics AX Client.

 

Regards,
Ariston Javier

Export Model in AX 2012 using Microsoft Dynamics AX Management Shell

A Model can be export and import into a model store.

Microsoft Dynamics AX Model is a set of elements in a given layer and each layer can be one or more models.

Model can be export to files using Microsoft Dynamics AX Management Shell and it will have .axmodel extensions.

Model exported called Model File or AX Model File.

Prerequisites:

  1. Administrative permissions on the local computer.
  2. System Administrator rights in Microsoft Dynamics AX.
  3. In Microsoft SQL Server:
    • Membership in the Securityadmin server role on the SQL Server instance.
    • Membership in the db_owner role in the Microsoft Dynamics AX database.

Procedures:

  1. Open Microsoft Dynamics AX Management Shell, Go to Start Menu > All Programs > Administrative Tools > Microsoft Dynamics AX Management Shell.
  1. At the Windows PowerShell command prompt, PS C:\>, type the following command, and then press ENTER.
    AX Management Shell:
    Export-AXModel –Model <name> -File <Filename.axmodel> 
    Example:
    Export -AXModel -Model "USR Model" -File C:\USR.axmodel
    
    Export Model AX2012
    
    Wait until it finished...
    
    Export Model AX2012 - Exported
    
    AX model files should be save and placed in C:\USR.axmodel
    
    Export Model AX2012 - Exported Location
    
    

     

    You can use the –Server, –Config, or –Database parameters to specify the environment to export from.

    You can also use the -Key parameter to specify the strong-name key pair file to use to sign a model.

    For more information, see Export-AXModel