web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Value of a field disappearing when form opened second time

(2) ShareShare
ReportReport
Posted on by
In the Electronic reporting destination settings i have created a custom setting named as "Azure Blob storage"  yab page in which i have three controls like Check box, named is Enabled, String control named KeyVaultname and string control named as Container where user will enter the blob container name.

The issue is when ever i enter some value in container field which is of type string and click on Ok button and close the form.

When i re-open the form again the value getting disappeared under container field .

Could anyone please provide some inputs here...

 
Categories:
  • Suggested answer
    Saif Ali Sabri Profile Picture
    on at
    Value of a field disappearing when form opened second time
    You're encountering a common issue in Electronic Reporting (ER) destination settings customization in Dynamics 365 Finance, where a custom string control (like your Container field) does not persist its value after reopening the form. Here's a clear and structured solution to resolve this issue:

    ✅ Root Cause:

    The Container field value is not being saved to the ER destination model or the related parameters storage, which means it only stays in memory during that session. Once the form is closed, the data is lost unless it's explicitly bound and saved.

    ✅ Solution Steps:

    You need to ensure data persistence by doing the following:

    Step 1: Extend the ER Destination Parameters Table

    1. Locate or create the custom table that stores your ER destination settings.
    2. Add a new field of type string (e.g., ContainerName) to this table to store the value of the container.
    3. Make sure this table is associated correctly with your destination.

    Step 2: Bind the Container Control to the Table Field

    In your form's code (or metadata designer if you're using extensions):
    1. Bind the Container string control to the new field ContainerName in the datasource.
    2. This ensures that any input is written to the database table.

    Step 3: Override Save/Load Logic (if needed)

    If you are customizing via X++, override the following methods:
    • loadSettings() – Load the saved value from the parameters table and populate the control.
    • saveSettings() – Write the current control value into the parameters table field before saving.
    Example:
    x++
    public void saveSettings()
    {
        super();
     
        // Save container value
        myCustomDestParams.ContainerName = containerControl.text();
        myCustomDestParams.write();
    }
     
    public void loadSettings()
    {
        super();
     
        // Load container value
        containerControl.text(myCustomDestParams.ContainerName);
    }
    Ensure that myCustomDestParams references your destination parameters table/datasource.

    Step 4: Rebuild and Test

    1. Rebuild the form extension or the custom destination handler.
    2. Open the ER destination settings form.
    3. Enter a value in the Container field, save it, close the form.
    4. Reopen – the value should now persist.

    ✅ Additional Tip:

    If you're using Key Vault integration, make sure you don’t accidentally overwrite custom fields during vault secret retrieval. Only secrets (like SAS token or connection strings) should be loaded from Key Vault; your Container name can be stored in a field.

    ✅ Summary:

    Action Description
    Add field Add ContainerName field to your custom parameters table
    Bind field Bind the string control to this field
    Override save/load Ensure your destination form saves and loads values correctly
    Test Reopen the form to verify persistence
     
  • Suggested answer
    Martin Dráb Profile Picture
    on at
    Value of a field disappearing when form opened second time
    SP-10070651-0, it's a pity that you didn't tell us what you've already for saving the data. In general, you'll need to extend ERFormatDestinationSettings class and how ERFormatDestinationSettings form works with the data (saving is handled in closeOk(), loading in init()). If you've already attempted to do so, use the debugger to see whether you have a problem is saving or the data gets saved but you have a bug in loading.
     
    Saif, blindly copying a misleading response generated by AI, and suggesting it as an answer, is decreasing the value of this forum and ruining your reputation. If you have no idea what the answer is, simply don't respond. Thank you.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans