Blog

Microsoft Dynamics AX Blog

Browsing all articles in Blog
3

A question might come to your mind, what’s the difference between a Dynamics AX 2009 Workflow Task and a Workflow Approval in AOT. They both are having almost the same properties and you could attach them to a workflow template.

Workflow in AOT

The workflow in Microsoft Dynamics AX 2009 is managed in a way that enables the workflow designer (who does the workflow configuration, a functional consultant in most of the cases) divides one “stage” approval into multi steps.

For example, if a Leave Request needs to be approved by the HR department, then the case might be in a way that approval must be processed by an HR Assistant and NOT the HR Manager in case that the leave does not exceed three days. But if the Leave Request is for more than three days… the HR manager must approve it also.

To enable this scenario, the workflow should be fixable so that the workflow designer is able to add as many steps per one approval “stage” as he likes. This is done by adding a Workflow Approval to the Workflow Template. When you go and configure this workflow template in the Workflow Configuration, you will be able to add as many steps as you wish… and you could also configure each step by specifying who this step will be assigned to and in what condition. And the workflow approval stage will not be completed unless all the steps are completed.

Now for the Workflow Task, this cannot be done. A Workflow Task represents only ONE STEP of a Workflow Approval. The workflow designer cannot add steps to this Task; he only could assign a person and a condition for this step/task. Task is nothing but a single unit of work.

The following image describes what I said:

Task and Approval in Dynamics AX 2009 Workflow

Another differnce is that a a task does not have a fixed outcome. However, you can add any number of custom outcomes to the task, such as Completed or Skipped.

3

I faced a very strange error two times so far saying that there is date2StrUsr function:

“The wrong number of arguments has been specified for the function”

and on the base enum DateFlags:

“The enumeration does not exist on DateFlags base enum”.

 Actually this has happened due to some “crash” in the SP1 of Microsoft Dynamics AX 2009. DateFlags and date2StrUsr with the new arguments have been added to SP1 of Dynamics AX 2009.

 I still do not know what the cause of this error is. The two times I have faced this problem were on two different clients where those clients were in the system configuration phase and some data were imported already. So before this error came up, there were using the system with the SP1 installed just perfectly.

Anyway, in order to solve the problem.. you simply have to uninstall the AOS only.. restart your server, re-install it again with the same name you were specifying as an AOS name.

I’m listing here the steps of how you do that in a safe manner. You might not go through them, but if you’re system is up and running and contains data that you don’t want to lose.. do the following:

  1. Stop the AOS service
  2. Backup your DB in case you something went wrong (you never know)
  3. Install a new another AOS instance, DB and Application Files for testing purposes (you don’t need to start the service here)
  4. Install SP1 on the new AOS and Application Files
  5. Run the service
  6. Open your Dynamics AX client on the new AOS configuration. Go with check-list steps.. most importantly: Compile and Database Synchronization (no need to import any data)
  7. After you’re done of the check list, go to AOT and try to compile: CurrencyExchHelper.. class. Insure that it complies with no errors. (This class uses DateFlags and date2StrUsr of SP1). If you see the same errors on this new AOS instance, then your SP1 installation went wrong. Re-install it again. You might also insure that you are using good installation files by downloading them again from PartnerSource.
  8. After insuring the the SP1 installation went just right, you might need to move also the customization you were doing on the old instance. So stop the service, get the customized layer like axVAR.aod for example and paste it in the new application folder.
  9. Run the service again, and compile the whole application by going to: Administrationà Periodic à Compile application
  10. Now, you need to re-install the AOS service in the same name, by:
    1. Uninstall the AOS from Programs and features on Windows 2008 or Add/Remove programs on Windows 2003
    2. Restart the machine (this is important)
    3. Install the AOS in the same name of the old service (do not run the service)
    4. Install SP1 for the new AOS
    5. Stop all services of Dynamics AX 2009
    6. Start the Microsoft Dynamics AX 2009 Server Configuration Utility and change the application Instance of the old AOS to the new application folder. Also do the same for the database (point to the new database).
    7. Run the Old Service.
    8. Open Dynamics AX client on the old configuration and go to the CurrencyExchHelper class. Compile it and insure that it shows no errors.  
    9. Stop the service. Go to the old application folder, delete the file: axapd.aoi
    10. Start the Microsoft Dynamics AX 2009 Server Configuration Utility. Point the new service (with same old name) to the old database and application folder.
    11. Run the service.
    12. Terarararaaaa it runs and no compilation errors again! It is recommended that you re-compile the application again.

 

 

1

If you ever called the AIF Sales Order Service in Dynamics AX 2009, then you had to specify the Customer Requisition (PurchOrderFormNum) field in SalesTable although this field is not really mandatory.

The Sales Order web service assumes that it is called from trading partners applications. Thus, whenever a sales order is created, this means that it has been created based on a request (Purchase Requisition most of the time) by this trading partner to your organization. And this requisition should be recorded in the PurchOrderFormNum field.

But why does the AIF Web Service create Journal type sales order then? The AxdSalesOrder class (the AX Document class) checks whether this sales order has been requested before by this customer (CustAccount field) or not. If it has been requested before, then this means that this customer (the one who sent this sales order document via the AIF Sales Order service) is purchasing based in the same Sales Order.. so Dynamics AX does not need to create another sales order, it creates Journal type sales order instead for the same customer and the same Customer Repulsion.

A great detail of the Sales Order Document Service is found in this link: http://msdn.microsoft.com/en-us/library/cc967401.aspx.

You might face the same scenario that I’m facing with one of my customers currently, that is migrating sales orders from an internal legacy system where you want only to migrate sales orders without checking for a Customer Requisition. If this is what you’re looking for, then all what you have to do is to comment the code in AxdSalesOrder class and prepareSalesTable method:

select firstonly localSalesTable
where 	localSalesTable.CustAccount 		== _axSalesTable.parmCustAccount() &&
	localSalesTable.PurchOrderFormNum 	== _axSalesTable.parmPurchOrderFormNum() &&
	localSalesTable.SalesId           	!= _axSalesTable.parmSalesId();
 
/*COMMENT FROM HERE
if (localSalesTable)
{
	_axSalesTable.parmSalesType(SalesType::Journal);
}COMMENT TO HERE*/
0

When you call the out-of-the-box AIF Sales Order Web Service, you might face a very strange and non-understandable error message saying:

The request failed with the following error: The element ‘SalesTable’ in namespace’http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder’ has invalid child element ‘QuotationId’ in namespace’http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder’.

If you faced this, and looked for a solution you might have gone to Dianne Siebold’s WebLog:http://blogs.msdn.com/dsiebold/archive/2010/01/21/request-failed-error-in-aif.aspx. Honestly, in the beginning I did not get what she said. Then when I got what she is trying to say, I did not like it :D, with all my respect to her of course.

Now when you dig in the XSD generated from the Sales Order Service, you would notice that the field Customer requisition (PurchOrderFormNum) is mandatory… you have to include it in your message. This is what this “unclear” message is all about.

But the question that might cross to your mind is why I should include such field in my Sales Order although I can create new sales order in the Dynamics AX Sales Order Details form with filling this field.

This is what I will explain in my next post :).

0

When I installed Dynamics AX AIF to a new server with these specs:

  • Windows 2008
  • IIS 7
  • .Net Business Connector

After installing those compoents + AIF Webservices (from the Dynamics AX 2009 media), you will not be able to view the .svc files in the IIS.

In order to vew the *.svc files and get the link in WSDL, you have to use the Service Model Registration toll in the .NET framework folder in windows. Follow these steps in order to have it viewed:

  1. Go to: Start> All programs> Microsoft Visual Studion 2008 (or 2005)> Visual Studio Tools> Visual Studio Command Prompt
  2. Write: cd <<<Windows installation path>>>windowsMicrosoft.NETFrameworkv3.0Windows Communication Foundation
  3. Write: ServiceModelReg.exe -i -x

If this completed successfully, you now are able to view/browse the svc (WCF services) in IIS 7.

0

My website is back!!!! :)

After spending nine sad days away of my lovely sweety website, blog any email due to domain expiration and silly excuses from the hosting company.

From today till three years you could find my blogging without facing any problems like amerax.net is not available!!

For those who visited my blog during the last nine days, please accept my deep apology and you’re welcome to come back again.

All my nice regards,,,

Amer Atiyah

0

Microsoft Dynamics AX University is conducting training session in Microsoft Innovation Center (MIC) at AlYamama University in Riyadh.

In March 2010, there will be two training weeks on Projects and Production modules of Microsoft Dynamics AX 2009. The schedule is as follows:

5. PROJECT TRACK # of Days    Register Here
Microsoft® Dynamics – Ax® Project I 2 06-Mar-10  
Microsoft® Dynamics – Ax® Project II 2 08-Mar-10  
Case Study 2 10-Mar-10  
6. PRODUCTION TRACK  # of Days   Register Here
Microsoft® Dynamics – Ax® Production I 2 20-Mar-10  
Microsoft® Dynamics – Ax® Production II 1.5 22-Mar-10  
Microsoft® Dynamics – Ax® Master Planning 0.5 23-Mar-10  
Case Study 2 24-Mar-10  

 

 General Information:

  • Time: 09:00 AM – 05:00 PM
  • This training is for Microsoft Partners only.
  • Price is 500 USD for each course for Microsoft Partners only.
  • Attendance certificates will be issued.
  • Course materials will be distributed.
  • Light lunch will be served.
  • Registration will be treated as CONFIRMED only if you receive confirmation email from Microsoft.
  • Confirmation will be first come first serve basis as seats are limited.
  • No attendance is allowed into the room without prior registration & confirmations.
  • Make sure you associate your windows id to a Microsoft Partner on the MPN.

 

For registration, please use the provided link, If for any reason, you were unable to register online, please send and email with the attendee details (Full name, Company Name, Mobile and Email) to i-emadb@microsoft.com.

9

When you install Dynamics AX Workflow, you might install it on a different machine that the AOS, like a web server for example. In this case, you have to install the following on the workflow server to get your workflow works:

  1. IIS
  2. .NET Business Connector
  3. Create a new website on IIS (do not use the same of WSS or EP websites, it is recommended not to use an existing website even)
  4. Workflow

Before going into step number “4”, you have to configure the “System service accounts” in: Dynamics AX –> Administration –> Setup –> Secuity. Fill these fields like the following:

  • Busienss Connector Proxy: create a domain account and assign it here, this user doesn’t have to be a Dynamics AX user.
  • Workflow System Account: Select a user like the Administrator  from the drop down list
  • Workflow Execution Account: like the previous step

Now you should be able to go through the step “4”, and install the Workflow component.

After installation, go to Dynamics AX –> Administration –> Setup –>Workflow insfrastructure configuration wizard. If you are getting an error after installing Dynamics AX Workflow: “401 Unauthorized”, then insure that you go through the following:

  1. AOS Service is running under an active domain user (domainusername)
  2. Workflow website and workflow application pool are having the same .NET Business Connector user name Identity (and of course, this should be an active domain user)
  3. You added the workflow website (http://servername:portnumber/DynamicsAXWorkflow50 for example) to the trusted sites in Internet Options of AOS server
  4. Run the following on the Workflow server:
    • Start a command prompt.
    • Locate and then change to the directory that contains the Adsutil.vbs file. By default, this directory is C:InetpubAdminscripts.
    • Type the following command, and then press ENTER:

cscript adsutil.vbs set w3svc/NTAuthenticationProviders “NTLM”

    • To verify that the NtAuthenticationProviders metabase property is set to NTLM, type the following command, and then press ENTER:

cscript adsutil.vbs get w3svc/NTAuthenticationProviders

The following text should be returned:

NTAuthenticationProviders       : (STRING) "NTLM"

 

By this, workflow infrastructure configuration wizard should work fine now. :)

0

Workflow in Dynamics AX 2009 is interesting technical part of this lovely product. When you try to develop/create a new workflow in Dynamics AX you might get confused of the so many menu items and classes that you create, and sometime you don’t even know what these classes’ handlers and menu items are used for. That’s why when I first learned how to create workflow in Dynamics AX one year ago; I created a pretty easy-to-use wizard that creates for you a workflow with all the necessary objects like Workflow Template, approval, category, classes and menu items. Furthermore, this wizard enables the workflow on the selected form and its main table.

One of the important classes that you need to set at the approval process is the participant provider. The goal of this property is for the workflow to decide who will be the participant user for this step of workflow. To do that, you have to extend WorkflowParticipantProvider class and overwrite the methods: getParticipantTokens that fills the list of options in the Role Based section of and resolve that will decide the exact user based on some X++ and the selected option in Role Based list.

Dynamics AX 2009 Workflow - Assignment - Role based

Dynamics AX 2009 Workflow - Assignment - Role based

By default, Dynamics AX 2009 comes with three participants:

  1. WorkflowUserGroupParticipantProvider:
  • List all configured User Groups in the system and assigns the workflow step to all users in the selected group
  1. ProjWorkflowParticipantProvider:
  • This is for Purchase Requisition workflow. List some tokens like Project Manager, Project Controller, Project Sales and others and assigns the workflow step to the assigned person of the Purchase Requisition project.
  1. TrvWorkflowProjParticipantProvider:
  • This is for Expense Management workflow. List tokens like Project Manager, Project Controller, and Project Sales and assigns the workflow step to the assigned person of the expense project.

 

Workflow Approval Properties

Workflow Approval Properties

So simply, when you need to specify participants based in your criteria, you need to do exactly the same of those classes, by overwriting getParticipantTokens and resolve.

1

I had the opportunity to review the new Dynamics AX books that were published by PACKT publishing. Currently I’m reviewing them and I will update you once I finish. Till that time, I’m putting here the second chapter of Microsoft Dynamics AX 2009 Development Cookbook.

Enjoy :) !

0

Today I attended the Microsoft Dynamics AX Industry Solution Event which was held in Marriott hotel in Riyadh. Microsoft Arabia MBS team was managing the show. Also five of Microsoft Dynamics AX partners in Saudi were there showing the business capabilities of Microsoft Dynamics AX 2009.

Mr. Emad Bakila, Microsoft Arabia MBS manager, started the event by describing Microsoft vision and strategy of Microsoft Dynamics in the market. He spoke about Microsoft Dynamics ERPs and Microsoft Dynamics AX roadmaps, high level features of Microsoft Dynamics AX, business market needs, adaptation of those needs with Microsoft Dynamics ERPs… etc.

After this partners started one by one to show features of Dynamics AX, each of them was showing one business field.

Partners and what they were speaking about is like the following:

Industry

Partner Name

Microsoft Dynamics AX for Discrete Manufacturing (ETO, MTO, MTS & ATO)

AlFanar IT

Microsoft Dynamics AX for Process Manufacturing

Mizon

Microsoft Dynamics AX end-to-end Solution for Retailers (Dynamics Solution in Managing Retail Products, Processes & Relationships for Greater Profitability)

Columbus IT

Microsoft Dynamics AX for Business Services (Dynamics Solutions to Help Increase Profitability and Client Service for Accounting, Legal & Business Consultants)

NetWays

Microsoft Dynamics AX for Construction/Contracting (Dynamics Solution in Effective Management of Projects)

Right

 Finally, Housam Wafai from Microsoft Arabia, described the implementation methodology of Microsoft Dynamics ERPs: Microsoft Dynamics Sure Step. Also at the end, he was showing a 15 minutes video showing the amazing capabilities of Dynamics AX like the BI tools, communication stuff, workflow… etc. I will try to get that video and update you guys with this.

Here are some pics from sessions of today (click to enlarge):

0

Dynamics AX Brains new website!

http://www.dynamicsaxbrains.com/

During the last two weeks, I was busy in reserving a domain and some conents in it for the Dynamics AX communithy in Saudi Arabia. Finally I was able to get a site and install the following parts:

  • Announcements
  • Events
  • Blogs
  • Forums
  • Downloads
  • and Feedback.

By all of those stuff in one place over the web serving the Dynamics AX ERP, we’re hoping the community members will find the website useful! :)

Dynamics AX 2012 Event

Recent Posts

Tags

Archives

Random Testimonial

  • ~ Shibu Purushothaman, Sr. Programmer at WorleyParsons

    0bd63bf"Working with Amer was a pleasure. He is a true professional with in depth knowledge of Dynamics AX, .Net and other Microsoft Technologies. His professional approach to design, implementation and training made our migration to Axapta easy, and with very little down time. Another quality that I think deserves a special mention is that working with him is a pleasure, not even once did we feel uncomfortable with Axapta even though we were from a .net platform. He took time to attend to our doubts, and made the transition from .net to Axapta a very smooth ride. I highly recommend Amer and cant wait to work with him again."

  • Read more testimonials »