Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

crm 365 Functionality not working as expected.

Posted on by

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

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: crm 365 Functionality not working as expected.

    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?

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: crm 365 Functionality not working as expected.

    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.

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: crm 365 Functionality not working as expected.

    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

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: crm 365 Functionality not working as expected.

    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 !!

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: crm 365 Functionality not working as expected.

    Hi,

    Share your code here, and the event

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: crm 365 Functionality not working as expected.

    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.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: crm 365 Functionality not working as expected.

    Hi,

    Let's try to debug it, perhaps the value is set when form is onload.

  • EmployeeOcta Profile Picture
    EmployeeOcta on at
    RE: crm 365 Functionality not working as expected.

    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.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: crm 365 Functionality not working as expected.

    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.

  • Suggested answer
    Preeti Sharma Profile Picture
    Preeti Sharma 2,678 on at
    RE: crm 365 Functionality not working as expected.

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans