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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to check field value and then run workflow

(0) ShareShare
ReportReport
Posted on by 26

I have a field on my form, lets call it "Test" and when the quote record is created the Test field defaults to Unassigned.  Now when that field gets changed from Test to any other valyue in this drop down field, I do not want an email to get sent.  However, once the Test field is changed from Unassigned to something else, I then want an email to be sent when it gets changed again.  (so not the first time, but the second time).

Example:  Create quote record, and Test = Unassigned  (no email sent)

                 Test field gets changed from Unassigned to "abc" (no email sent)

                 Test field gets changed from abc to 123 (now email should get sent)

                 Test field gets changed from 123 to 456 (email should get sent)

Hope that helps, please let me know how I can make this work.  Thank you.

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi Partner,

    I suggest that you could create a new custom field named "counts" which is used to store the times that the option set field number of updates.

    For example, you created a number field named "Counts" on  your quote form. Then you need to add some JS code on the onchange event of your "Test" option set field.

    Add the code in "Test" onchange event.

    function calculateNumber(executionContext){
        var formContext=executionContext.getFormContext();
        var number=formContext.getAttribute("new_counts").getValue();
        formContext.getAttribute("new_counts").setValue(number 1);
    }

    Add the code in form onloading event.

    function intializeNumber(executionContext){
        var formContext=executionContext.getFormContext();
        formContext.getAttribute("new_counts").setValue(0);
    }

    When we loading the quote form, the "Counts" is 0, and if we update the "Test" field, the counts changed.

    pastedimage1601520804894v1.png

    pastedimage1601520818570v2.png

    pastedimage1601520835908v3.png

    So you could use this "Counts" field as a condition in your workflow.

    Best Regards,

    Leo

  • Suggested answer
    Pankaj Gogoi Profile Picture
    3,177 on at

    Hello,

    Is there a possibility that the field may get changed from ABC to Unassigned?

    If you have audting enabled, then I would suggest having a custom workflow and fetch the old and new values using AttributeAuditDetail

    https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg309735(v=crm.8)

    Best Regards,

    PG

  • gopi.royal999@gmail.com Profile Picture
    430 on at

    I think, simple workflow should solve the problem here or am I missing something big.

    1) On Create  - > check for Test field contains data -> Send an email else ignore.

    2) On Update, Configure Test field on the field changes list. This will ensure that the work would trigger only whenever Test Field changes  -> check for Test field contains data  --> Sent an email else ignore.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 76

#3
Martin Dráb Profile Picture

Martin Dráb 64 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans