datetime2str Error on Workflow Controls

11 12 2009

I came across an interesting error within Dynamics yesterday when testing workflow on a VPC image of a clients environment. I submitted a Purchase Requisition into workflow and all went ok, however when one tries to navigate back to that record (or any other record submitted to workflow) on that form (i.e. when the workflow controls/ yellow bar is updated) the following error is displayed.

 Error executing code: Wrong argument type for function.

 (S)\Classes\SysWorkflowFormControls\getActionBarContentForOriginator - line 32
 (C)\Classes\SysWorkflowFormControls\showOriginatorContent - line 19
 (C)\Classes\SysWorkflowFormControls\updateControls - line 76
 (C)\Classes\SysSetupFormRun\updateWorkflowControls - line 4

The Error seems to be linked mainly to datetime2str function call with in SysWorkflowFormControls.getActionBarContentForOriginator method.

The solution as described in this Communities Post is to simply ensure that you have installed at least Service Pack 1 to your AOS instance after restoring the clients environment onto the VPC or server.




One response

25 08 2010

Hi Jon,
In case you dont want to install SPI to get rid of this error,
you could simply remove the datetime2str method.

For eg,
you could write “datetime2str(lastActionDateTime, DateFlags::FormatAll)”
as “lastActionDateTime”.
Make sure you do these changes in three places in SysWorkflowFormControls Class.

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

%d bloggers like this: