Why is my yellow workflow bar not displaying

20 09 2010

My most common complaint regarding workflow from users or developers is “MY YELLOW WORKFLOW BAR IS NOT DISPLAYING”. So here is my mental checklist of probable causes to help resolve this common issue (this is a list in progress as there always seems to be a a new reason for why this is happening, so if you have found additional reasons please post them in the comments below)

1) Check that your canSubmitToWorkflow method on your form is returning true, if you are trying to submit to workflow. It may be that the rules that are setup are not allowing the record to be submitted. e.g. no lines have been added yet for the Purchase Req.
2) If the user is supposed to be approving the record, check that the record is still assigned to him (Basic -> Workflow History). This sounds silly but users often see the email notification in outlook and try and approve their again when it may already have been approved or escalated.
3) Check that a workflow configuration exists and is marked as active for the record type in question
4) Ensure that your form is workflow enabled.
5) Ensure that the correct data source is marked as the workflow data source for your form.

If you are still struggling, here are some less common reasons
1) No submit menuitem has been defined for workflow template selected as the active workflow configuration. I’ve experienced this when I’ve got 2 workflow configurations for the same record type with the first configuration kicking off the second one as a sub-workflow. In this case the second workflow does not require a submit menuitem. However Dynamics AX marks both as default and may pick-up the one without the submit button as the default and subsequently not anything because no submit button is available.

Happy Daxing.


Reset Delegate Due Date

17 06 2010

Dynamics AX 2009 workflow has functionality built in by default to delegate work-items to new users. But what happens if your workitem is about to escalate when you delegate? The new assignee may only have a very short time to action the item. So if you want to reset the due date time of work-items on delegation, here is a quick and dirty way to get it right. Be warned, this is modifying a framework class so you will need to be careful when upgrading.

Class SysWorkflowEventDispatcher::onWorkitemDelegate

//Declare Variable (line 23)
WorkflowDateTimeTemp _dueDate;
//Generate and set new due date (approx line 114) after Setting description, before notifying assignee
_dueDate = SysWorkflowProviderService::resolveDueDate(_workItemContext.parmWorkflowCorrelation().parmWorkflowContext(), stepTable.StepId, workItemTable.UserId);
workItemTable.DueDateTime = DateTimeUtil::newDateTime(_dueDate.parmWorkflowDate(), _dueDate.parmWorkflowTime());

//notify the assignee
notification = EventNotificationWorkflow......

Happy Daxing

Calendars in Workflow

10 06 2010

If you have been using Dynamics AX workflow for a while, you would have noticed that calendars and times form quite an intricate part of how workflows are managed.

They are used to determine amongst other things:

  • How long workitems are assigned to users
  • When escalation should occur
  • How long before escalation steps should last before causing final actions

One of the ways to specify the timing for the above is by using calendars in AX.  In this post we will do a quick walk-through of how to setup a calendar for use in your workflow.

Step 1- Setup working time template
Note: Working time templates provide a way to define standard working times for your company from which various calendars can be created and customized.

  • Open an Dynamics AX client and navigate to Basic -> Setup -> Calendar -> Working time templates.
  • Click new and give your template a name and description e.g. Workflow (Working times used by workflow)
  • Click on the Monday tab, click new and set the operating times for your company e.g. 8:00 am to 5pm. (You can always specify 2 or more operating time records per day if you take lunch or would like that to be taken into account for workflow).
  • If you use the same operating times for each day in the week, click the copy day button on the right hand side and copy the times to each day one at a time.
  • If you have differing operating times per day, follow the above procedure for each of the day tabs.
  • Close your form.

Step 2 – Create your calendar

  • Navigate to Basic -> Calendar.
  • Click new and give your calendar  a name.
  • Create your working times for this calendar by clicking on the working times button.
  • On the Working times screen click the ‘Compose working times’ button.
  • Select the dates for which you would like to create working times for. Make sure you create enough future dates so that your workflow date assignments will always resolve otherwise you may get an stopped error. I recommend at least one year (default) or more.
  • Note: You can set up a batch task (via the batch tab) to run periodically to keep your calendar refreshed with new dates .
  • Select the working time template that you created in step 1 and click OK. You should now see a list of working times composed for your calendar.
  • You have now setup your calendar and can use it within all your workflow configurations.

Happy Daxing.

P.S. As a side note for developers, if you haven’t defined a DueDateProvider for your Workflow template you will not get the option to define due dates when configuring.

Workflow Error: Stopped (error): Error in call of method EventContextInformation.unpack

27 11 2009

I just got the following error message in my Dynamics AX Workflow history. It appears that the original context record for this workflow instance (purch req) was deleted, and when workflow tried to escalate the work item it failed as the PurchReq no longer existed. One needs to add the relevant checks to ensure that the original context records cannot be deleted while it is in workflow.

Stopped (error): Error in call of method EventContextInformation.unpack

Full Error log:

Exception thrown in     :
 Workflow work item escalation failed:  
   Error in call of method EventContextInformation.unpack

%d bloggers like this: