--- title: "'Error Executing Code: Wrong Type of Argument for Conversion Function'" slug: "error-executing-code-wrong-type-of-argument" description: "This article provides a solution for the following error when trying to run a report: 'Error executing code: 'Wrong type of argument for conversion function'." tags: ["Error message", "Lasernet Connector ", "Query wizard", "Base64", "AX2012", "Element"] updated: 2025-11-10T11:04:21Z published: 2025-11-10T11:04:21Z canonical: "kb.lasernetgroup.com/error-executing-code-wrong-type-of-argument" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # Error Message: 'Error Executing Code: Wrong Type of Argument for Conversion Function' This article provides a solution for the following error that may appear in AX 2012 when trying to run a report: > [!CAUTION] > Error > > Error executing code: Wrong type of argument for conversion function. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-1NK3DZQG.png) ### 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 the 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: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-GA61SXX1.png)