web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

General strange issue - some fields on the form are not saved

(0) ShareShare
ReportReport
Posted on by 2,505

I encountered a very strange problem for the second time.

Some fields on a form are not saved after clicking "Save" button. I get the old values instead.

I found a workaround:

  • Remove those fields from the form, save and publish
  • Add those fields to the form again, save and publish.

I faced this issue twice on the forms that were working very good before. That means this could happen again. 

Does anyone know this problem?

*This post is locked for comments

I have the same question (0)
  • AFTAB HUSSAIN Profile Picture
    Microsoft Employee on at

    Hello Justasd,

    Are these fields custom fields or default crm fields?

    Does this happen on all the forms (entities) in CRM or on some selected entities. Also mention if those are custom entities or Out of box entities.

    Thank You !

  • justasd Profile Picture
    2,505 on at

    Hi  AFTAB,

    The fields are all custom and the entities are standard. It happened for me twice: on the Opportunity and Tasks forms

  • Vijay Waghmare Profile Picture
    on at

    Hi,

    You can use attribute.setSubmitMode("always") to ensure all problematic attributes are pass to save. This will avoid removing/adding and publishing attributes again and again.

    Add setSubmitMode("always") for required attributes on page load event to avoid data loss in future.

    Thanks,

    Vijay

  • Community Member Profile Picture
    on at

    Thank you Vijay, I was struggling to find a resolution to this issue a while back; and to make matters worse, the field in question triggered a workflow that was supposed to close the request!!

    Can someone verify if this is a desired "feature" of CRM 2011 or a bug?

    Only, if I programmatically ask a field to perform an action I think it odd that a mandatory safe-guard should be there on any form that isn't the default 'information form'

  • Suggested answer
    Demian Rashkovan Profile Picture
    130 on at

    Hi justasd, this kind of things happen when there are some readonly fields. The Readonly fields by default are doesn't send to the server.

    If you want to be sure to send these fields values to the server, be sure to forcé them only if they have new values, otherwise they will sent to the server every time (and maybe fire any workflow or plugin).

    My recomendation is to forcé the submit only if they are dirty. put this in the OnSave event:

    attribute.setSubmitMode("dirty");

    hope this helps

  • Suggested answer
    Hosk Profile Picture
    on at

    sounds like you have read only fields on the form.

    you need to set this

    attribute.setSubmitMode("dirty");

    then the fields will be saved

  • CompassVale Road Profile Picture
    5 on at

    I meet the save issue with you.

    Your should set the fileds like this:

    getAttribute("fieldName").setSubmitMode("always");

  • Community Member Profile Picture
    on at

    Hello, where in the settings do you find the option to add that to the form?

    "attribute.setSubmitMode("dirty");"

  • mscrmba Profile Picture
    on at

    It's a piece of Jscript.

    You need to add a Jscript web resource.

    Then you can set Form Properties>Events: Form Library and Event Handlers

    Are you a developer?  Do you have a developer that can help you get started?

  • Community Member Profile Picture
    on at

    Yeah I'm a developer but I am very new to dynamics CRM.

    So I created a new web resource (java script) and added this to my script. Then I'm going to go to the entity and apply the new resource to it. Does this sound correct to you guys?

    function form_onsave(){
    getAttribute("statecode").setSubmitMode("always");
    }

    EDIT: I added my resource & published but it didn't work. I then removed the javascript file and the entity started saving after I published again. I'm not a fan of CRM.

    Anyways, here's a link for others if they come across this posting with some examples.

    http://blogs.msdn.com/b/arpita/archive/2012/02/19/microsoft-dynamics-crm-2011-force-submit-on-a-disabled-field-or-read-only-field.aspx

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans