Workflow – Detailed Development

Ok.. My previous write-ups included installing and configuring workflows and brief description for developing workflows. I got some time to create a document which explains in detail about how to develop workflow artifacts.
I have taken an example of Purchase order invoice approval process.
Here is the document Workflow – Development
Here is the link to the sample XPO of the scenario Purchase order approval project
Note: There are some existing objects that have been modified. The user should take care while importing the project and look for possible conflicts that may arise.
See Also:

21 thoughts on “Workflow – Detailed Development

  1. This Development document helped me a lot and my work finished smoothly.Thank you very much Summit, for taking the time to write this document and sharing with us. 🙂

  2. Dear Sumit,

    Your document on work flow creation has helped me a lot.
    But i am facing problems while creating condition for purchase order approval while configuring the work flow which i created.
    I have used the code and steps which you have given in the document.

    My error is,
    Error executing code: TaxPurch object not initialized.

    (S)\Classes\PurchTotals\displayFields – line 91
    (S)\Classes\PurchOrderDocument\parmTotalAmount – line 8
    (S)\Classes\SysExpression\buildXmlDocument – line 112
    (S)\Classes\SysExpression\buildXPathDocument – line 49
    (S)\Classes\SysExpression\evaluate – line 103
    (S)\Classes\SysWorkflowExpression\evaluateWithoutInstance – line 65
    (C)\Classes\FormButtonControl\Clicked – line 10

    I can not find the solution.
    Please help me in this if possible.


  3. Above error has been solved!!

    Now the yellow bar is not appearing on the purchase order form.

    How to solve this problem???

    Kindly Reply

    1. On the Purchase order form, please check what the method, canSubmitToWorkflow is returning. Also ensure that there is a data source specified for WrokflowDataSource property on form design.

  4. Hi sumit!!!I have developed the workflow on sales quotation form.
    On that form work flow is working properly.
    Now need to customize for approval procedure!
    Is there any proper document available for that??
    If yes can you share it??

  5. Thanks Sumit for this Post. I follow your post regularly now and your contents and presentations are awesome.
    Keep doing good work…

  6. Dear Sumit,

    Thank you so much for your pdf on workflows-development. I wanted to try this xpo given here but i am having this error when i try to download it. I would highly appreciate if you can reactivate it. Thanks a lot

    [Parse error: syntax error, unexpected T_NAMESPACE, expecting T_STRING in /home/axaptapedia/www/www/includes/Namespace.php on line 46]

  7. Dear Summit,

    Iam trying to create a EP workflow, but i strucked up with an error following error when i click Submit button in workflow:

    Dynamics Object Adapter Call failed.
    Error executing code: EPWorkflowControlContext object not initialized.


    (C)\Classes\EPSTSLeaveWFActions\submitToworkflow – line 22
    (C)\Classes\EPSTSLeaveWFActions\dispatchWorkItemAction – line 8
    (C)\Classes\EPSTSLeaveWFActions\main – line 22

    I think SubmitToWorkflow class is not executing, even i could not able to debug x++ code when am using EP to trace error.

    Please help me, i googled it but could not find solution, can you please help me..

  8. Hi Ramabala,

    Looks like you are not passing the workflow context as expected. In EP there is a concept of contexts that passes the selected record from one webpart to another or to an action. For more information, check the Expense approval on EP. You can check expenses from EP -> Employee services -> Manage expenses.

    There when you create an expense and configure a workflow, you can submit it for approval. You can take some cue from that web part and see the context passing.


    1. ok.. i will check it.. Thanks for your reply.

      i installed and configured EP on a instance, later i installed one more instance of Ax 2009, now when i open VS and started working, in AxDatasource control, datasetName property is pointing to list of all datasets of 2nd instance instead of 1st instance. How to configure VS to point to a specific instance of Ax09?

      Please guide me..

  9. Hi Summit i have done all the work flow developement from you link above and installation,settings on accounts payable- purchase order form, but i can’t see the work flow ribbon on the form, can you help?

    1. Are you checking them in existing POs or did you try to create new ones? If they are existing POs, then you may have to set their Workflow state field to “Not submitted”. The new ones will have this field set as Not submitted and then it should be visible

  10. I have submitted a purchase Requisition record to the workflow.But in the Workflow history form the status Pending.My record is not submitting to the work flow.I don’t know what is the problem in that.I have to change any settings in the server.

    1. Hi Rahul,

      Can you check the tracking and see if the workflow remains in the activated state? If that is case, try following:

      1. Check the event log on AOS (there will be separate application log for Workflows) for possible errors. Try and search the errors on the net and you might find the solution
      2. From Basic –> Setup –> Settings for workflow, try and validate the URL and see if passes validation

  11. HI Sumit,

    I have in all 21 workflows configured, all are running properly. But sometimes the approval starts and the workflow work item is not created, the workflow gets stuck. I have configures batches properly and they are not going into error, hierarchy of the user is also proper. also the service is not restarting and the workflow IIS is also running properly. I have checked the event log of batch-AOS server as well as IIS server but fount nothing.

    The amount approval for workflow is less then 1000 and we have applied the KB2398999 patch.

    I am using AX 2009 with sp1. Can you please suggest what might cause this problem.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s