Hello All Experts,
1. Custom entity
2. grid records.
after clicking on the individual record i go to the individual entity record form.
there is b.p.f having some stages.
to save the current stages name I find that a custom code is written on form load and save events which does take the value as stage name and set it to the custom field on the form which is of type single line of text.
when i click on Next Stage on b.p.f the bottom right corner button automatically changes to saving for sometime and later stops to normal position i.e. save button .
when i move back to the 2. grid records i saw the same record Stage Name still old one,
now again i click on that same record and move to individual entity record form there i find bottom right corner button showing Unsaved Changes .
This behavior is very annoying , can anyone help me in resolving this .
*This post is locked for comments
Hi,
you may try to find out, is there any other javascript/business rule is setting the value into new_name.
One more thing you can check is ,didyou set the "new_name" submitmode to always without proper checking?
Hello Jie,
i have debug in dev environment it's working as JavaScript debugger also getting hit in this.
But in test environment debugger is not getting hit.
so in place of
var name = GetName(stageId);
replaced with hardcode value.
var name = "TestValue";
this is working.
but on the form same field is getting IsDirty. Now my query is who is making the "new_name" field to dirty.
is it any business rule or something else.
Hi,
do you know how to debug javascript?
put your breakpoint in "if (Xrm.Page.getAttribute("new_name").getValue() != name)"
Let's see if you getting the same name
Hello Jie,
below is the code .
function Update() {
var stageId = Xrm.Page.getAttribute("stageid").getValue();
if (stageId != null && stageId != "") {
var name = GetName(stageId);
if (Xrm.Page.getAttribute("new_name").getValue() != name) {
Xrm.Page.getAttribute("new_name").setValue(name);
}
}
}
but i doubt the same code works in the dev instance but it do not in the other instances.
what is causing this to not work !!
Hi,
Share your code here, and the event
Hello Jie,
I explicity set setsubmitmode to always for a custom field which is in dirty mode on form save and form load event,
but still the same issue.
i think this may be happening because of multiple business rules on the single entity.
can you elaborate this problem.
Hi,
Let's try to debug it, perhaps the value is set when form is onload.
Hello All Experts,
I find that there is one field on the form which is in IsDirty mode.
why it's not getting saved .
although the same logic working in Dev but not in test environment.
Hi,
maybe you can give a try to double check the BPF between two instances. Since the error message stated the required field is not complete.
Hi,
Please check if fields marked as required are filled before moving to next stage.
Moreover,we faced same issue once. Required fields in bpf were containing values but error was thrown as "To move to the next stage, complete the required steps.". To resolve this only solution we had was to delete the fields from solution and recreate it. After that it was working fine.
Thanks
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156