Translate

Thursday, June 14, 2012

AX 2012 Workflow Customization

Hi Guys,

During these I have working with customisation of Workflows in AX 2012. AX 2012 provides a bunch of APIs which are really easy to use it and create new workflow in AX 2012.

Just you can follow the steps in attached file.

Happy DAXing.. :)

40 comments:

  1. Fair & clear topic to know about workflow customization. Thank you.

    ReplyDelete
  2. Mukesh, Ur tutorial has been very help full. Can u assist me develop a workflow type for stock requisition? "Attached on the invent movement journal"

    ReplyDelete
    Replies
    1. Just try out to develop, if you face any issues then lemme know.

      Delete
  3. Hello Mukesh,
    I have downloaded your document and started following the steps.
    however i have missed the part where you say "Modify the code for the main method as shown in the following code". there is not reference to the code i have to copy paste into the Main method. please help.

    thank you
    Rola

    ReplyDelete
    Replies
    1. If you have a created different method for Submit then you can call your method from main method, else u can directly write the logic in main method.

      Delete
    2. Thanks so much for the quick reply.
      i have moved my code to the Main method of the class.

      have you by any chance made any workflow for the sales process?

      thanks again,
      Rola

      Delete
    3. the Sales order process.. starting from creating a new sales order and ending at the sales invoice?

      Delete
    4. Hy Rola,

      Yeah u can develop the same. Post me if u face any issues.

      Delete
    5. Dear Mukesh,
      I have followed your document and developed a workflow for the sales order document. it all worked well. however, i need to add a stop error that executes when the user clicks the submit button and prevents him from submitting the sales order to the workflow. any advise?

      thank you,
      Rola

      Delete
    6. Hy Rola,

      U can write ur logic in canSubmitToWorkflow method.

      Delete
    7. Mukesh,

      I've also using your logic for sales order creation to confirmation just like system done with purchase order process. But unfortunately workflow submit button hasn't appeared on salesTableLisPage form. Kindly help me to get out of this situation.

      Delete
  4. Dear Mukesh

    Thanks you very much

    I have created workflow in AX 2012 working fine in all Scenarios Except following :-

    (
    I am facing issue on ReSumit workflow button click generating exception "Function run has been incorrectly called.".
    Please guide.
    )

    Regards and Thanks,
    Asif Sanaullah

    ReplyDelete
    Replies
    1. Hy Asif,

      As per my knowledge resubmit logic is not provided in above scenario. U need to add that functionality..

      Delete
    2. Refer to class BudgetPlanReviewWorkflow in AOT or any other standard workflow classes ReSubmit logic is defined in those classes.

      Delete
  5. I have encountered an error while creating a workflow configuration, same error i 've observed in the Workflow document u have shared.

    Error in AX: "An unexpected error has occurred while opening the workflow. See the event log on the AOS and contact your system administrator to resolve the issue."

    the Error Description in Event log: "Workflow threw an exception for the following reason: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state."

    &

    "Workflow threw an exception for the following reason: A call to SSPI failed, see inner exception."

    Can u please suggest a solution for the same.

    Thanks in advance

    ReplyDelete
    Replies
    1. Perform Full CIL... it should solve..

      Delete
    2. Thanks.... It is working fine now

      Delete
    3. i m facing this same error ..i have already done full CIL but not working.please do let me know regarding this issue


      thanks in advance

      Delete
  6. Hi Mukesh,

    I am facing one issue regarding ax2012 purchase requistion workflow .Here is the below details of problem
    >Purchase requisitions do not properly display workflows if line-item and header workflows are both used in the same workflow.

    Below step i m following not getting expected result.
    Purchase Requisition Workflow
    1. Go to: Procurement and Sourcing > Setup > Procurement and sourcing workflows
    2. Click New
    3. Select Purchase requisition line review
    4. Click Create Workflow
    5. Drag the Review purchase requisition line element from the left workflow elements and drop it onto the canvas.
    6. Connect the Start – Review PR – End
    7. Click Save and Close.
    8. Click OK on the Version Notes window.
    9. In the Activate Workflow window, select Activate the new version.
    10. Click OK.
    11. Back at the Procurement and sourcing workflows, click New.
    12. Select Purchase requisition review.
    13. Click Create Workflow.
    14. Drag the Purchase requisition line-item workflow element from the left workflow elements and drop it onto the canvas under start.
    15. Drag the Review purchase requisition line element from the left workflow elements and drop it onto the canvas between the PR line item workflow and End.
    16. Connect it as follows: Start -> PR line item -> Review PR –> End
    17. Click Save and Close.
    18. Click OK on the Version Notes window.
    19. In the Activate Workflow window, select Activate the new version.
    20. Click OK.
    21. Go to: Procurement and sourcing > Purchase requisitions > All purchase requisitions
    22. Click New Purchase requisition.
    23. For the Name: TestWorkflow
    24. Click OK.
    25. Click Add line
    26. Enter the following:
    a. Procurement Category: Audio
    b. Product Name: test item
    c. Quantity: 5
    d. Unit: ea
    e. Unit Price: 20
    27. Click Financials
    28. Select Distribute amounts
    29. Assign Ledger Account: 110180
    30. Click Close.
    31. Click Submit.
    32. Click Submit again.
    33. CTRL + D to open AOT
    34. Go to: Forms > Tutorial_WorkflowProcessor
    35. Right click on Tutorial_WorkflowProcessor and select Open
    36. In the Processor, click Start.
    37. After the workflow has processed from the queue, press F5 to refresh the purchase requisition.
    38. Click Actions and select Complete to complete the PR line-item workflow.
    39. Click Complete again.
    40. After the workflow has processed from the queue, press F5 to refresh the purchase requisition.

    Actual result:
    The View History is displayed for the PR line-item workflow. You should see the option to complete the PR Review Workflow (Document level).
    Expected result:
    You can see the PR Review Workflow Actions menu just like you can from the All purchase requisitions list page on the AX client.


    Do you have any idea regarding expected result...waiting for your quick reply

    ReplyDelete
  7. Dear Mukesh

    Your Work Flow document has helped me a lot.Thank you Very much.Mukesh can you please help me ,if we have new module and if we want to Apply Work Flow in the New Form in the New Module.

    Thank You

    ReplyDelete
  8. Dear Mukesh,

    As per your document I have created this workflow but while setting it up I am getting an error
    "The previous element do not exist". Path given is \Previous element

    I am unable to find this path to solve this, Plz help regarding this.

    Sanjay

    ReplyDelete
  9. Hi Mukesh,

    This was very helpful, Thanks

    Regards
    Hitesh

    ReplyDelete
  10. Hi Mukesh,

    I have developed the sales order workflow as per your document, all goes fine, but when i submit a sales order for approval, the message processing queue works fine, but i am not getting any popups or notifications. Also i am not able to see actions & View History for a Document. Could you please Help brother !!

    ReplyDelete
    Replies
    1. @arun do you find any solution for your query ?

      Delete
  11. Hi Mukesh,

    i unable to find any attachment here where it was
    i am new to workflow may i know which class or methods will call at the time of approving workflow

    ReplyDelete
    Replies
    1. https://docs.google.com/open?id=0B1GCZFk-upztVThocm9vSFNBcUE

      Delete
  12. Hi Mukesh,
    Can you please tell me after adding sales workflow i need to disable the button before approved and enable it after approval
    and if i deactivate the workflow the button should be as it is i.e enabled.

    ReplyDelete
  13. Hi,can you please tell me in which scenario we will create workflow?

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Hi Mukesh,

    I am facing an issue in Invoice Approvals. When User submits an invoice in the workflow,the Invoice Line disappear after the first step of approval.
    This is very unusual behavior, as even now the error appears for some invoices while other invoices complete the workflow approvals without any error.

    Any guidance will be appreciated.

    Thanks.

    ReplyDelete
  16. Hi Mukesh,

    The sales order workflow is failing for multi line sales order , If sales order has one line item , it was working perfect. If it has more than one line, the workflow stops after submitting it.

    ReplyDelete
  17. Hi Mukesh,

    The sales order workflow is failing for multi line sales order , If sales order has one line item , it was working perfect. If it has more than one line, the workflow stops after submitting it.

    ReplyDelete
  18. Good evening !
    Can any one share the link to download the pdf for Master Planning / Retail / Inventory Management in AX
    i am working for a retail consumer electronics industry as Manager Operations taking care of Front end operations and also back end
    I need even the link for POS
    Pl help
    regards
    N.Ramprasanth
    ramprasanthn@gmail.com

    ReplyDelete
  19. Hi Mukesh,

    i unable to find any attachment here where it?
    i am new to workflow.
    i read all comments and need your valuable Document. please Provide Your Document or related Link.

    ReplyDelete
  20. Hi Mukesh,
    I am new to workflow. can you help me any blog regarding workflows. when we have to create, how to create give basic idea and easy to understand the work flow .

    ReplyDelete
  21. anyone can please provide me xpo file
    i'v already flow up the steps on that pdf but i faced many issue about that
    because user can do invoiced sales order without approve workflow

    ReplyDelete