Announcements
Ok, two part question here as I am really new to Dynamics 365. Is there a way under Accounts and Contacts to search for any record that has the Unsaved tag on it? Referring to when you open the record up, see the record name in the top NAV bar and it ends with either - Unsaved or - Saved.
I keep coming across tons of unsaved records and setting up business rules are not tripping properly because the record is unsaved. Save the record and then the rules run fine and all is good. I just can't seem to find a way to search and find these records.
Second part of the question is if I can search and find these records, is there a way I can save them in bulk?
Thanks.
Jayson
Call below function on load of the form. If the issue is still persisting then remove it from the on load and use the same function on change of the depended field(field which is updated by Business rule)
function onload_save(executionContext)
{
var formContext = executionContext.getFormContext();
formContext.data.entity.save();
}
Thank you,
Amit Katariya
Yes it can... You can try it once. Else we can create a js which will run on change of a field which is changed by business rule and save the record.
Thank you,
Amit Katariya
So is this confirmation that auto save will allow Business Rules to run and the record then gets saved without manual intervention?
No but you can enable auto save function...
Ok, so I think I am understanding this now as it is the business rules that are on the form that are causing this. I have a few business rules on the form especially based around rollup fields as you can't update other values based on a rollup field without a business rule. So that leads me to ask these two questions.
1. Is there a way to search for records that are unsaved?
2. Is there a way, in a business rule, to state "when done, save record"?
Thanks.
Yes as you already said you guys are migrating the data...that means records are created using the API's Or using some other automation tool(like using kingsway software) that means records are not created manually... So once you will open this record your business rules or JS will kick in which will chck the form data and make depending field updates.... And because of that you are facing this issue..... If you want to check what custom logic causing the issue you will have to enable audit history and save your record and check which fileds are changed. Once you will have changed fields data check the logic on this field...
You will get the culprit...
Thank you,
Amit Katariya
Thank you for the reply. We are new on D365 and I noticed the unsaved scenario during our migration and the vendor told us this was normal. Is that the correct response they should have provides us, probably not but it is what it is now. I do have some business rules running on the forms so I guess the question is, when those run, can they or should they be set to save the record? Additionally, we do not have Auto Save turned on in the account. Is that part of my problem?
I would really like to see if there is a way to search this out still and pull a list but I don't know if a tag exists for unsaved anywhere in any of the entity tables.
Hi Jayson,
I would suggest you to refer below link and check which fields are getting dirty when you open any records:
https://carldesouza.com/checking-isdirty-dynamics-365-using-javascript/
Now, once we have fields then you need to check which business rules and javascript are updating the dirty fields.
If business rules are making the fields dirty then you need update Business Rule to run only in certain condition such only on create form. For Identifying Create form in business rule you can use Created On. Because during record creation Created On field will be null.
Similarly, in javascript you identify the form type as described in below link:
https://neilparkhurst.com/2015/11/11/javascript-getformtype/
Note: Xrm.Page willl get replaced by formContext.
Hello User,
If you are facing this un-save issue after record is opened, then check status of respective record before opening it, from the advance find and once after opening it. if you notice any status change then it can be result of some custom logic.
Thank you,
Amit Katariya
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156