Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Workflow to create record on custom entity

Posted on by 85

Hi all

I recently asked and got an answer to this question - https://community.dynamics.com/crm/f/117/t/322940 thanks Kokulan . However the trigger action requirement has now changed. 

To recap, we have a new activity entity called Quality Issue Investigation. 

The requirement is to create a new record for Quality Issue Investigation when the status reason of a case is changed to Quality Investigation. I say Status Reason not Status to be sure it is not confused with record active/inactive.

I have created a workflow to trigger when status reason changes, checks if the Status Reason is Quality Investigation and then create a new Quality Issue Investigation record. However it is not creating the new record. I can not see why? 

Is this the right way to create a new record off of a field change trigger?

*This post is locked for comments

  • Suggested answer
    Mark WHE Profile Picture
    Mark WHE 85 on at
    RE: Workflow to create record on custom entity

    Hi Charles,

    Right now I have 1 active workflow that works.

    But to answer your question;

    At the time of posting this question, I had 1 process, in the background, that did not appear to work. As mentioned in my OP I had previously tried an on demand process (that did not work).

    Subsequent to posting I realised I may not have set the scope to Organizational in the original on demand process, so I decided to create a new on demand workflow. This is when I posted my "I have resolved" post.

    So at that point I actually had 2 active workflows (designed to achieve the same result) 1 on demand and 1 background. The new on demand process when tested worked. I tested it 4 times. However when i went back to the first test case, I saw I had 2 of the new Quality records (as was the same with the other 3 test records). This is when i posted the response to your question about updating the status field.

    I am assuming the second record was created by the background process, because when i deactivated the background process and tested again I only had one new Quality record created. 

    As a result of this, i wondered if there was some sort of timer or batching mechanism on a background process, hence the question How do i find out when a background workflow is set to run? Which Kokulan has just answered.

    The background process not working makes no sense to any of us. My explanation? There was a gremlin in the works somewhere, which cleared off when i tested that new on demand process.


    Hope that clears things up a bit.

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Workflow to create record on custom entity

    How do i find out when a background workflow is set to run?

    If the workflow is set to trigger on a Record Event (Create/Status Change/Field Change..etc) and if the workflow Scope is set to Org Level and if the workflow is Activated, It is set to run.  I have never come across any scenario where the workflow did not trigger when the above settings are in place.

  • Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: Workflow to create record on custom entity

    Hello,

    I think we miss something here. Can you please explain to us how many workflows you have and how they are supposed to run, and what they do...?

  • Mark WHE Profile Picture
    Mark WHE 85 on at
    RE: Workflow to create record on custom entity

    Hi Kokulan

    Yep, my workflow matches except i had Automatically Delete selected.

    The workflow has now fired, but only seemed to do so after i triggered the second on demand workflow - giving me 2 new records.

    Same question as i posed to Charles, How do i find out when a background workflow is set to run?

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Workflow to create record on custom entity

    Hi Mark

    I have just tried a workflow on my trial instance and it seems to work fine.

    Please make sure, the highlighted are set correctly.

    5700.ScreenClip-_5B00_103_5D00_.png

    I have tried changing status reason couple of times and please see the logs

    5700.ScreenClip-_5B00_103_5D00_.png

    Try the workflow owner account with a Sys Admin role and with above settings, I don't see why it cant work. 

    The version I tried on :

    5700.ScreenClip-_5B00_105_5D00_.png

  • Mark WHE Profile Picture
    Mark WHE 85 on at
    RE: Workflow to create record on custom entity

    Hi Charles

    the update is done manually in the record, so select from list and save record.

    The strange thing is, with the on demand workflow working, I think the background workflow has also triggered because when i tested the new workflow, i ended up with 2 new records.

    How do i find out when a background workflow is set to run?

  • Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: Workflow to create record on custom entity

    How are you updating the status reason field? (even after some time, the background WF is not trigerred?)

  • Mark WHE Profile Picture
    Mark WHE 85 on at
    RE: Workflow to create record on custom entity

    Hi Charles,

    Thanks for the response. It posted while i was writing the previous reply.

    As I say i have it working now as an on demand process. What would be the cause of the background job not working?

  • Suggested answer
    Mark WHE Profile Picture
    Mark WHE 85 on at
    RE: Workflow to create record on custom entity

    Okay, i have resolved this. The other workflow that was not set to run in the background, had the scope set to user. I created a new on demand workflow and set the scope to organization and it works fine.

  • Suggested answer
    Charles Abi Khirs Profile Picture
    Charles Abi Khirs 3,569 on at
    RE: Workflow to create record on custom entity

    Hello,

    The workflow looks good and should normally work.

    1. Make sure that the Status Reason is being updated.

    2. In the workflow, uncheck the option "Automatically delete completed jobs" and check if there are workflow jobs being created or in the case record, look into the background processes

    3. check if there are any other DEV that might be preventing the update of the Status Reason field

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans