Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Opportunity Price List Removed after Create (unsaved changes message)

Posted on by 115

Hello,

I have an issue with the opportunity entity. When it is created, normally the Price List is prefilled in the script, but after saving it gets removed and I get "Unsaved Changes" message (see screenshot)

9848.png

There are no scripts that are executed after save, and we do have a plugin that is triggered on Pre Create event, but I also debugged it and it doesn't have an impact on Price List.

Does anyone have an idea what might be happening that causes this?

Thanks!

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Opportunity Price List Removed after Create (unsaved changes message)

    I faced the same issued. In Opportunity, Revenue is defaulted as UserProvided and PriceList is null. Whenever I save a new Opportunity, the form remain unsave changes because of PriceList field. I've tried with Revenue as System Calculated and fill the Price List, Price List was saved to DB as I selected, but the same, unsave changes occours on form after save.

    As a solution, as I don't want to use priceList for the time being, changed the setSubmitMode for Price List Field as Never. 

    Here is the javascript code on formLoad

    Xrm.Page.getAttribute("pricelevelid").setSubmitMode("never");

     


    I don't know whether it is the proper solution or not, but it's solved for the time being.

    If someone find any proper solution, reply please.. 

    Thank you.

  • tayapr Profile Picture
    tayapr 165 on at
    RE: Opportunity Price List Removed after Create (unsaved changes message)

    Hey Denis,

    I don't have a solution yet but wanted to let you know you are not alone in facing this issue.

  • deno43 Profile Picture
    deno43 115 on at
    RE: Opportunity Price List Removed after Create (unsaved changes message)

    There are no business rules on the form.

    There are plenty of scripts onload and onsave event which do hide/save alongside with other stuff, but none of these scripts removes a value.

    Regarding setSubmitMode - why do you think this would help? The value is removed after save (not before save) - because I get "Unsaved changes" error.

    Is there some kind of CRM built-in logic that could cause this?

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Opportunity Price List Removed after Create (unsaved changes message)

    Not sure what business logic you have in the form, there should have some business logic which is clearing the field.

    Could you please check following

    - Is there any business rules having in the form related to that field .

    - check is there any script in the onload and onsave event.

    - Try to do field setsubmitmode always in the onload event  

        Xrm.Page.getAttribute(fieldId).setSubmitMode("always");

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans