RSS

Monthly Archives: August 2014

Free X++ Editor Extensions for AX 2012 – Setup under 5 minutes

If you are a .NET Developer and has to work with X++, you will definitely miss all the nice and rich features that VS Editor provides to developers. Sometimes we just take it for granted. I was on the hunt to look for an AX extension that can help me to write better code and avoid frustration when dealing with long lines of code. I found this extension is so easy to install and setup under 5 minutes.

Step 1: Download the zip file at Codeplex

http://ax2012editorext.codeplex.com/releases/view/111153

image

Step 2: Extract the library

image

Step 3:   Copy and paste all files in the extracted folder to your AX client folder

image

Step 4:  Test Run

  • Starting and ending of brackets.

image

  • Collapse and un-collapse sections wrapped with {- and }-brackets.

image

  • Highlight the all occurrence of keyword in method similar to  NotePad++

imageimage

Inspiration: http://yetanotherdynamicsaxblog.blogspot.com/2013/03/free-editor-extensions-for-ax2012.html

 
Leave a comment

Posted by on August 31, 2014 in Development

 

AIF – How to get a better error message and stack trace for a failed document?

How many times when working with AIF you got an error and have no idea what caused the issue. The document fails for many reasons and what you get is a very generic error message. Debugging AIF is a painful process and time consuming. Below is the trick that we can find out more descriptive error message and even a stack trace.

image

image

Run the job below and replace the GUID with the GUID from the document that failed

static void TestOutboundMessage(Args _args)
{
    guid id = str2guid("{BCE9B13D-3F3C-497F-A566-55606C3F19B4}");
    
    AifQueueManager document;

    select firstOnly document where document.MessageId == id;

    // This static method is declared as private and this trick is to avoid changing the access specifier on the class
    new SysDictClass(classNum(AifOutboundProcessingService)).callStatic('processAsUser', [document.MessageId]);

}

Refresh and review the error again, you will see a more descriptive message and a stack trace that can save your life.

image

 
Leave a comment

Posted by on August 26, 2014 in Development

 

Tags: , , , , , ,

DIXF – How to regenerate target entities

There is time when you add custom fields to staging table and they do not appear in your Target when you promote data from STAGING to TARGET. The reason the new fields do not appear in TARGET because it does not know there are new fields that we need to regenerate field mapping for the target.

There are 2 ways to do this, I’m going to show you both LONG WAY and SHORT WAY

LONG WAY

1. Go to the DIXF area page. Click on Target entities.

image

2. Find the entity in the list.

clip_image001[5]

3. Click on the “Modify target mapping” at the top:

image

4. Click on “Mapping Details”

image

5. Click on “Generate mapping”

clip_image001

6.  Answer “Yes” to prompt

image

7. You should see your new fields in the list

clip_image001[13]

SHORT WAY

Run either one of the 2 jobs below

This jobs run for all entities

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;
 
    // delete all target Mappings
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap;
    ttsCommit;
 
    // Regenerate Target Mapping for all Entities
    while select dmfEntity
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }
 
    info("All Done!");
}

This one run for  one entity. Make sure to replace your <Entity Name> with your entity

static void regenerateDMFTargetMapping(Args _args)
{
    DMFTargetXMLToEntityMap     dmfTargetXMLToEntityMap;
    DMFEntity                   dmfEntity;
 
    // delete specified target Mapping
    ttsBegin;
        delete_from dmfTargetXMLToEntityMap where dmfTargetXMLToEntityMap.Entity = <EntityName>;
    ttsCommit;
 
    // Regenerate Target Mapping for specified Entity
    while select dmfEntity where dmfEntity.EntityName = <EntityName>
    {
        DMFTargetXMLToEntityMap::generateMapping(dmfEntity);
    }
 
    info("All Done!");
}

ADVANTAGE OF USING JOBS

Sometimes it is not possible to regenerate the target mapping for a particular entity as clicking on “Modify target mapping” generates an error.   This error typically reads along the lines of

“Duplicate assignment found for the following target field <some field name>”

DMFDuplicateAssignment

“Cannot create a record in Target XML (DMFTargetXML)”

image

Run the job will fix these issues.

 
2 Comments

Posted by on August 26, 2014 in Development

 

Tags: , , , , , , ,

SSRS Report in R3 – VS 2012 vs. VS 2010

Problem:
In R3 environment, when I tried to to edit a report,  i received the following message
“Unable to preview the report, install the Business Intelligence Development Studio feature of Microsoft SQL Server For more information”

image

AOT > Visual Studio Projects > Select a project > Right Click > Edit

image

Notice that VS 2010 is still being used as a default one.

image

Solution:
AX R3 still needs to integrate with Visual Studio 2010 and therefore you have to have BIDS (Business Intelligence Development Studio). You can use a SQL Server 2008 R2 installation image to install it (it’s one of the components you can select during installation of “A new standalone server or additional components” on the client machine.

SQL Server 2008 R2 Setup Feature Selection

How to installing(adding) features (SSRS) to an existing SQL installation. Please follow this link:
http://mssqltrek.com/2012/02/10/installingadding-featuressrs-to-an-existing-sql-installation/

 

Tags: , , , , , ,

Inside Microsoft Dynamics AX 2013 R3

Can’t wait to receive this book

image

Dig into the architecture and internals of Microsoft Dynamics AX 2012 R3 – with firsthand insights from the team that designed and developed it. Deepen your knowledge of the underlying frameworks, components, and tools – and deliver custom ERP applications with the extensibility and performance your business needs. Useful for Microsoft Dynamics AX solution developers at all levels, this guide will provide max benefit to those who understand OOP, relational database, and Transact-SQL concepts.

Gain best practices, patterns, and techniques to:

  • Exploit interoperability with Microsoft Visual Studio tools
  • Work with MorphX and avoid common pitfalls with X++ code
  • Use Enterprise Portal with ASP.NET and SharePoint for rich web-based apps
  • Simplify process automation with built-in workflow infrastructure
  • See how the runtime implements security and configuration
  • Design and customize the user experience
  • Gain greater control over complex batch jobs
  • Customize the prebuilt BI solution and reporting
  • Test applications, publish services, and optimize performance
 
Leave a comment

Posted by on August 19, 2014 in Development

 

Tags: , ,

AIF – How an external .NET web app can invoke AIF services

Issue:

A .NET Web application calls an AIF service but keeps getting an error “Logon failure: unknown user name or bad password.“.

When i created my own .NET Console application to consume this service. I had no issue making a request.

What seems to be the problem? Permissions? Roles? Cross Domain? Trusted intermediary?

Solution:

Note: I assume you know how to make service request through .NET. I only show how to set up from AX side.

1. Create a Custom Service

You can use any service available out of the box or create a new one. In my example below, I created a custom service

2. Create a “Claims user”.

System Administration > Common > Users > Users > New User

clip_image002

IMPORTANT: Make sure you have to create a role and privilege with all necessary access to entry points as well as tables that you use

image

3. Setup your custom service as “Enhanced” port with “Trusted Intermediary users”

clip_image004

4. Add super user and claim user

clip_image006

Additional Information

You can read more about Trusted Intermediary from this blog.
http://daxmusings.codecrib.com/2011/11/trusted-intermediary-in-aif-services.html

http://stackoverflow.com/questions/18704978/cannot-connect-to-ax-web-service-form-asp-net-but-can-from-console-application

The only additional setup up that i create is to assign a Role to  the claim user.

 
Leave a comment

Posted by on August 13, 2014 in Development

 

Tags: , , , ,

AIF Document Schema Caching Issue – “Invalid Document Schema”

Scenario: I created a ledger journal service that create general ledger journal by using Inbound Transform to transform a CSV file to XML.

  1. I generated a schema for my document for my service. (Note that i have additional custom fields in ledgerjournaltrans but then later i removed few fields and reupdated my document).
  2. i created a C# .NET application to transform the document using the schema above

When i started testing, i kept getting error with the schema for a field that i no longer used. If i dropped a XML file directly to my INBOUND folder, it worked fine but if i dropped it as a CSV and using Transform, it kept saying “Invalid document schema”. Note that the XML document is created by the same Transform class. I am thinking it could be some schema cache issue with the custom service.

Solution 1: The AIFRUNTIMECACHE table will hold cached details for the AIF document classes.  You should be able to clear this table if you believe it to be a caching issue.  In fact you can disable cache entire if you’re working in a DEV environment, if it’s production keeping cache enabled is recommended.  You can use the steps below to disable AIF runtime caching.

1. Open the AOT and expand form

2. Find the AIFGlobalSettings form and open it

3. Disable the caching check box

image

Solution 2: Rewrite your transform class with different class name and reload the assembly through Manage Transform

 
Leave a comment

Posted by on August 7, 2014 in Development

 

Tags: , , , ,

 
%d bloggers like this: