Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Workflow question....

Posted on by 2,645

I have a workflow creating a task when a user selects Yes or updates this field from No to Yes.  Also, if the field is Yes, and they change it to No, a task will generate.  However, now they don't want a task to be triggered when the field moves from blank to No.  Can this be done, if so how?

Thank you.

*This post is locked for comments

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Workflow question....

    Hi ,

    Sorry I am bit confused your last post "I would need it when it is created and not saved yet as well as after it being saved." , do you mean that you need to create the tasks when the record not being saved as well? In that case you need to write JS code to trigger wrokflow on-change event.

    In addition what I understand from your older post  can proceed with below steps with real time workflow - 

    Step 1 :

    If you need to create tasks when the record is created with field Value "Yes" till now its clear in that case you can go for workflow starts when record is created. As at the time of record created there is no old field value which means its null to "Yes",. In the workflow check condition if Field Value  =="Yes" trigger task workflow.

    Step 2:

    You need to create tasks when record is being updated which means you need start workflow when record field change . In that case see below article which Ravi has shared already -

    dyn365pros.com/.../using-microsoft-dynamics-crm-workflow-to-update-a-field-before-the-value-is-changed

    So there should two conditions when Field A does not contains data and then  under that another if condition when field value is "Yes" , trigger task workflow or create tasks.

    Hope this helps.

  • USA80 Profile Picture
    USA80 2,645 on at
    RE: Workflow question....

    Would that work when the record is being created or would that only work once the record is saved once already?  Because I would need it when it is created and not saved yet as well as after it being saved.

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: Workflow question....

    As mentioned earlier this cannot be achieved using a workflow.

    no matter even if you trigger a plugin "before" field changes. That would of no use since you cannot actually check the before value in workflow.

    Using Images in plugin is an advanced topic , you cannot jump onto this if you are new to plugins. Kindly start with some basic plugin tutorials and go on from there.  

    i have a silly suggestion -   Since you have mentioned user manually selects this yes or no - create a business rule check if this field is null which will trigger on load - you create another field and may be set the value which you can then utilise in your workflow.

    so in short if field was null - you are setting a new field value to "yes".

    1. in your workflow now if you check if( this new field is yes & the original is also yes or no) --- this signifies that the value was changed from null to no or yes

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Workflow question....

    Hi..

    Sorry i miss understood your question..

    This is not possible in just workflow.. you have to write Plugin for this.

    You have to write plugin on post-update event for this entity and pass Pre-Image with attribute field A,B.

    In plugin code, you need to compare pre-image value with value updated, when value in Pre-image for field A is blank and update value = No, then you dont have to create task, in other cases you can create task.

    Here are some more details pre-images

    community.dynamics.com/.../pre-image-and-post-image-in-dynamics-crm

    community.dynamics.com/.../utilising-pre-post-entity-images-in-a-dynamics-crm-plugin

    community.dynamics.com/.../pre-image-38-post-image-explained-33

    crmbook.powerobjects.com/.../plug-in-images-pre-vs-post

    Hope this will help..

  • USA80 Profile Picture
    USA80 2,645 on at
    RE: Workflow question....

    My Field A and Field B contain Yes, No, and TBD.  By default the field is blank.  So can I do to ensure that when the field goes from blank to No, that a task will not trigger?

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at
    RE: Workflow question....

    hi..

    1. Make sure your workflow is triggering on "Record Status changes" and "Record field change"

    trigger2.PNG

    trigger2.PNG

    Then add conditions and create tasks as follows

    trigger3.PNG

    Now when ever option set value is changed from Black to Yes or No or Yes to No or No to Yes or record status is changed to Deactivate, workflow will be triggered and task will be created. 

  • USA80 Profile Picture
    USA80 2,645 on at
    RE: Workflow question....

    Here is more detail that may help someone to help me.

    I need to create a workflow with the following criteria:

    Task workflow will trigger from No to Yes for Field A or Field B

    A Task will trigger upon deactivation of the record

    Upon a change from Yes to No in Field A or B

    A task should be triggered when either Field A or B moves from blank to Yes

    A task should NOT be triggered when either Field A or B moves from blank to No.

    I have a background workflow that is working for it all except the last line.  I tried the real-time workflow, but do I need to turn all of these steps into a real-time workflow?  Thank you for your help.

  • USA80 Profile Picture
    USA80 2,645 on at
    RE: Workflow question....

    It seems to be running, but incorrectly yet.  I am using child workflows as well now, as I should be right?

  • Verified answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Workflow question....

    Hi ,

    Make sure you  save the record for real time workflow  , you don't need to do anything .

  • USA80 Profile Picture
    USA80 2,645 on at
    RE: Workflow question....

    If I do real-time workflow, does it still run by itself behind the scenes or does the user have to manually kick it off?  I tried to test this and nothing ran behind the scenes automatically.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans