--- title: "Apply a custom argument as range parameter to an export" slug: "apply-a-custom-argument-as-range-parameter-to-an-export" tags: ["Concept topic"] updated: 2026-04-08T14:02:50Z published: 2026-04-08T14:02:50Z canonical: "docs.staedean.com/apply-a-custom-argument-as-range-parameter-to-an-export" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Apply a custom argument as range parameter to an export You can apply customized arguments as range parameters to a data export from D365 F&SCM. ### **Custom code** To create a range parameter as an argument, you must add the desired method along with its argument to the BisDialogBase class. The method must be defined as follows: dialogBase.setFieldValue('[argument]', [code to define the argument value]). ### **Document** You can use the argument as a range parameter for the source document if it is a D365 F&SCM document. To do this, add a range of type **Parameter** to the relevant document record, typically the root record. In the **Range** field, input the exact name of the argument. Ensure that each argument used in a document is unique to that document. ### **Example** Suppose you want to add the following parameters to the document record range: - company: This is used to get and set the current company. - origCompanyId: This is used to get and set the original company. The BisDialogBase class contains the following code: ```plaintext dialogBase = new BisDialogBase(); dialogBase.setFieldValue('company', companyRule.Company); dialogBase.setFieldValue('origCompanyId', companyRule.getOriginalCompany().CompanyId); mArgs.packedBisDialogBase(dialogBase.pack()); ``` Add the parameters to the document record range: ![](https://cdn.document360.io/da662430-6a41-47b1-8c7e-7e4ac37a9756/Images/Documentation/Images/File%20imageB46242E2-6319-46B0-ADCD-B147A04AAD3F) > [!NOTE] > **Note** > > If you run a message from code, you can apply these parameters as well. ## Related - [Run a message from custom code](/run-a-message-from-custom-code.md) - [Define range](/define-range.md) - [Develop custom code](/develop-custom-code.md)