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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Double Save Issue in Offline App with Business Rule and JavaScript

(4) ShareShare
ReportReport
Posted on by 17

In a model-driven app with offline capabilities, I am facing a persistent issue where a double save is triggered under specific conditions. The app involves a business rule updating the ReceivedOn field. Here are the details:

  • Offline Behavior: The issue persists both with and without internet connectivity.

  • Testing Results:

    • JavaScript (OnSave/OnLoad) was used to set ReceivedOn, but the double save issue persists.

    • Business rule updates to ReceivedOn also trigger double save.

    • Disabling auto-save did not resolve the problem.

    • In an online-enabled app (without offline capabilities), everything works as expected with a single save.

    • A custom entity mimicking Created On behavior was tested with JavaScript, yet the double save remains unresolved.

I was able to reproduce this issue in a vanilla environment. Is this double save behavior expected in offline mode? Are there any workarounds or known limitations within the Dynamics 365 offline framework?

Categories:
I have the same question (0)
  • Verified answer
    Holly Huffman Profile Picture
    6,522 Super User 2025 Season 2 on at
    Double Save Issue in Offline App with Business Rule and JavaScript
    Good morning, afternoon, or evening :) depending on your location!
     
    The double save issue in offline mode for model-driven apps is a known limitation within the Dynamics 365 offline framework. This behavior occurs because offline mode uses a local database to store changes, and certain triggers (like business rules or JavaScript updates) can cause additional save operations to sync data between the local and server databases.
     
    Workarounds:
    1. Avoid Business Rule Updates on Save:
      • If possible, avoid using business rules to update fields like ReceivedOn during the save process. Instead, consider using a plugin or server-side logic to handle these updates after the record is saved.
    2. Optimize JavaScript Logic:
      • Review your JavaScript code to ensure it doesn’t inadvertently trigger additional save operations. For example, avoid setting field values in the OnSave event unless absolutely necessary.
    3. Disable Auto-Save (If Not Already Done):
      • While you mentioned disabling auto-save didn’t resolve the issue, ensure that it’s disabled in both the app settings and the form properties to minimize unnecessary save triggers.
    4. Test with Simplified Logic:
      • Simplify the logic in your business rules and JavaScript to isolate the cause of the double save. For example, temporarily remove all custom logic and reintroduce it step by step to identify the trigger.
     
    Hope this helps!

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Sahan Hasitha Profile Picture

Sahan Hasitha 193

#2
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 70

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 69 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans