Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to send an email when any field on my form is changed?

(0) ShareShare
ReportReport
Posted on by 2

I have an Entity (form), with a lot of fields on it.  I have a request from a user that wants an email sent to them when any field on this form is modified.  How can I configure the email of this workflow to show them what field(s) have been changed?  Would be nice to know what the old value was and what the new value is as well if possible.

Thank you.

*This post is locked for comments

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    Once again you did it.  Thanks again!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: How to send an email when any field on my form is changed?

    Try this then (just replace the same part as before):

    if(attributes[i].controls.get(0).getLabel() != "Modified Fields")

    {

     if(result != "") result += ", ";

     result += attributes[i].controls.get(0).getLabel();

    }

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    That looks very good.  One last thing I swear :-)  When the last field is placed in the email message showing that it has changed, can the comma be removed at the very end?  For instance:

    Fields that have changed:  Due Date, Status, Details,

    Can that last comma be removed if there are no more fields that have been modified?

  • ashlega Profile Picture
    ashlega 34,477 on at
    RE: How to send an email when any field on my form is changed?

    Sure, though it's really more about javascript than CRM now. You can try something along these lines:

    Replace this:

    result += attributes[i].controls.get(0).getLabel() + ";";

    With this:

    if(attributes[i].controls.get(0).getLabel() != "Modified Fields")

     result += attributes[i].controls.get(0).getLabel() + ", ";

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    Sorry, one more thing.  When I try the workflow it shows the name of my field which is called, "Modified Fields," but it shows up like this:  Modified Fields;Program Type;Priceing

    I would like just the actual fields that have changed, so if type a sentence that says, "Here are the fields that have changed:" can it show Program Type (and then a coma with space), Pricing

    Just wondering, thank you.

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    Thanks for everything, you sure know your stuff.  

  • Verified answer
    ashlega Profile Picture
    ashlega 34,477 on at
    RE: How to send an email when any field on my form is changed?

    Yes, that should work

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    That worked like a charm.  Now for the workflow.  I have one created.  For the area where it says Start when: I have the checkbox checked for "Record is created" and "Record fields change," I clicked the Select button and checkboxed my new field that I created.  Then down in the bod of the process, I just selected Send email.  All sound right?

  • ashlega Profile Picture
    ashlega 34,477 on at
    RE: How to send an email when any field on my form is changed?

    You might try to replace this line:

    result += attributes[i].getName() + ";";

    With this:

    result += attributes[i].controls.get(0).getLabel() + ";";

  • USA80 Profile Picture
    USA80 2 on at
    RE: How to send an email when any field on my form is changed?

    Ok, I didn't had the new script to the Form Libraries section, I added it there now too, and it seems to be working.  However, it is showing the name of the field behind the scenes not the display name, is there a way to fix that so it is more user friendly for the client?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans