locked
how to set IsDirty property = false for lookup attributes RRS feed

  • Question

  • We are setting default value for some of the attributes onLoad, because of which  while closing ,close alert is coming even if user has not modified any value.  for text value we have fixed it by setting defautVaue = Datavalue but for lookup this is not working.how to set IsDirty property = false for lookup attributes

    Thursday, February 2, 2012 9:16 AM

All replies

  • Hi Aaarav

    After you populate the lookup field, try force submitting the field.

    CRM 4.0:

    crmForm.all.<<fieldname>>.ForceSubmit = true;

    CRM 2011:

    Xrm.Page.data.entity.attributes.get("<fieldname>").setSubmitMode("always");

    Please let me know if this helps.

    Thursday, February 2, 2012 9:50 AM
  •  but forcesubmit will set isDirty= true for that lookup which we dont want.

     anyway i tried it but still it is giving close alert

    Thursday, February 2, 2012 11:11 AM