Error Message: 'Error Executing Code: Wrong Type of Argument for Conversion Function'
    • 20 Mar 2024
    • 1 Minute to read
    • Contributors
    • PDF

    Error Message: 'Error Executing Code: Wrong Type of Argument for Conversion Function'

    • PDF

    Article summary

    This article provides a solution for the following error that may appear in AX 2012 when trying to run a report:

    Error

    Error executing code: Wrong type of argument for conversion function.

    Resolution

    This error is caused by at least one of the elements on the reports having the wrong argument type.

    To correct this, apply the following steps:

    1. Select the report Elements and review that the type is correct for all the fields.

    2. If necessary, change the type by clicking the drop-down menu and selecting a different type.

    This issue is more common with manually added fields but can also occur for fields that have been added via the Query wizard and whose type has been changed in Elements. This issue is also most common with the type Container, as in the following example.

    One of the elements may have a wrong type, for instance, a Container when it should have been a Base64File. This scenario and the drop-down used to fix it are highlighted in the following image:


    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.