Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Unanswered

Auto Save Dirty Changes

(1) ShareShare
ReportReport
Posted on by 8
Hi all,
 
I have a pretty straightforward but catastrophic issue going on in regard to one of our business processes. 
 
The need: Immediately auto save/commit all dirty changes on a record as they occur, at least for one specific entity
 
The reason for the need: We have a robust custom system in place that helps us keep track of inventory levels across all warehouses' product inventories in D365 field service. The problem is that when products are used in work orders, or products are added to a product inventory via an inventory adjustment or transfer, the product inventories are not committing the changes to the quantity available/quantity on hand values.
 
This is a big issue because there are rollup fields on each parent Warehouse record that aggregate the total number of all products across all product inventories, and reports are run on this data. With unsaved changes lingering on the product inventories after adjustments, the rollup fields become inaccurate and thus affects any reports drawn from them. The same issue occurs when a new product inventory is added; the quantity available is not reflected in the parent rollup fields until I physically open the record and manually save it.
 
(I can tell the changes are not being saved, as every time one has its quantity updated, the record shows unsaved changes)
 
I have exhausted myself unsuccessfully attempting to put together a solution to this, including creating power automate flows to update the record and force the changes to commit, workflows, custom ribbon commands, on change events. An ideal solution would be javascript code that would always save/refresh the record when the quantity field is modified, or a custom ribbon command that would allow me to select records from either a grid or subgrid and save/refresh all selected, committing any unsaved changes.
 
If anyone has any insight at all on why this might be occurring, please let me know. Thanks so much!
  • CU26071520-1 Profile Picture
    CU26071520-1 8 on at
    Auto Save Dirty Changes
    I think I solved the problem! I replaced a business rule I had on the form with a workflow that would accomplish the same thing, and the product inventories are now saving when modified. Thank you for the suggestions!
  • Shashank Bhide Profile Picture
    Shashank Bhide 932 on at
    Auto Save Dirty Changes
    Dynamics has an auto-save for all entities OOB, first try that, though I'm still not very clear what's causing the page to become dirty, rollup fields shouldn't cause that AFAIK. you might have to review if any JS is at work here, lastly there's an ugly way to do auto-save using JS, where you write a timer which runs every X seconds and checks if page is dirty and saves the page automatically, but that's not an easy solution, sometimes the manual save and timer based save can run at the same time giving unpredictable results, even the OOB auto-save creates a lot of problem and in most of the projects where I've worked, it's kept turned off.
  • CU26071520-1 Profile Picture
    CU26071520-1 8 on at
    Auto Save Dirty Changes
    Hi Shashank,

    Thanks for taking a look at this. I'll explain more what I mean:

    On the Warehouse entity main form, I have several rollup fields that add together the quantity available fields for all of their related product inventories. What I mean by "product is added to inventory via inventory adjustment or transfer" is in reference to the out of the box Dynamics 365 Field Service functionality of an inventory adjustment product, which will always have either a parent Inventory Adjustment or Inventory Transfer. 
     
    The adjustment product is what actually updates a warehouse's product inventory. The problem is that when this happens currently, the product inventories that were affected still show unsaved changes. This then causes the rollup fields on the parent warehouse record to have old, inaccurate data which can't be used in reports. My goal is to avoid this by forcing the record to save if there ever are any unsaved changes.
     
    This is a server side process so I am thinking that it may be a matter of java script on the product inventory record. Does this mean that if I want product inventories to be saved and committed when the quantity available is updated by the system, that I need to remove any formula fields? I don't have java script but I do have a couple formula fields. Are these causing the lingering unsaved changes? Let me know if you need any more information, thank you!
  • Shashank Bhide Profile Picture
    Shashank Bhide 932 on at
    Auto Save Dirty Changes
    Trying to understand more here, when you say "product is added to inventory via inventory adjustment or transfer", are you talking about a server side process? because if the database commits are happening at the backend, then the client side form shouldn't show "Unsaved", a form is unsaved when a JavaScript is silently updating fields on the form, but if changes are taking place on the server side, then you shouldn't see a dirty form.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard

Featured topics