Hello,
I have a requirement, If the record in my model driven app is assigned to Person-A and Person-A is staying on the page and doing research, Person-B re-assigns this record to himself. Without refreshing the screen, Person-A would not know the owner has changed. If Person-A tries to move to the Next Stage in BPF then a popup should appear to inform Person-A that the record owner is now Person-B.
The issue I'm facing here is I'm able to show the popup but still the stage is moving forward when the owner is changed, which is wrong. So, I need to stop the BPF moving to next stage.
I've tried using preventDefault() function but no luck.
Can anyone help me with this please?
Hi,
Please enable the async onSave feature and try to prevent the save if the owner is changed.
Please refer to my blog, it maight help you: https://xrmtricks.com/2022/01/09/optimistic-concurrency-in-model-driven-apps-forms/
Good Luck !
Please tick Accept as solution if the answer is useful.
https://xrmtricks.com/
Yes I've added the preventDefault() in success part of Xrm.WebApi.retrieveRecord inside function preStageChange(). I know that Xrm.WebApi.retrieveRecord is asynchronous so I've used 'await' but still the form is getting saved.
Hi @Anonymous,
You mentioned that you tried the preventDefault function. Did you make this call within a function that is registered for the onPreProcessStatusChange event? If so, can you add a Console.log statement in the same function to make sure that your code is actually executing?
---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.
stampcoin
17
ankit_singhal
11
Super User 2025 Season 1
mmbr1606
9
Super User 2025 Season 1