Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Phone Call - Dynamically change activity's status

Posted on by 165

Hello,

I've added a custom two-options field in the phone call form, where user can select if the phone call is Completed or Scheduled.
The requirement is that when user selects 'Completed', the Activity status of the phone call should automatically change to 'made' and the user shouldn't have to manually close the activity via the dialogue.

I've made a workflow where I change status to 'Made' if user has selected 'Completed' but it does not seem to work.

Any help would be much appreciated.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Phone Call - Dynamically change activity's status

    Hi irenegr,

    1.workflow.

    You can create a workflow to change status when field value has changed with ‘completed’

    pastedimage1599213555430v1.pngpastedimage1599213563873v2.png

    You can go settings > System Job to see running details of the workflow.

    Through test, I notice that the workflow only run when record create, though option field change, it can’t trigger the workflow.

    So if you want to change status when option field change, add Js code to onChange event is a good way.

    2.JS

    (1) JS code.

    function setState(executionContext) {
        var formContext = executionContext.getFormContext();
        var option = formContext.getAttribute("new_selectstatus").getValue();
        if(option==true)
        {
        Xrm.Page.getAttribute("statecode").setValue(1);
        }
    }

    (2) Add your JavaScript code in a Script web resource.

     pastedimage1599213577386v3.png

    (3) Add an OnChange event with this Script web resource to the Phone call entity form.

    pastedimage1599213584089v4.pngpastedimage1599213593668v5.png

    (4) Test

    pastedimage1599213603230v6.png 

     

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Phone Call - Dynamically change activity's status

    On top of what others have already suggested,  make sure the workflow scope is set to Organisation level and also make sure the workflow is set to trigger on the two options field value change.   Could you share a screenshot of your workflow?

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: Phone Call - Dynamically change activity's status

    Could you please check the process sessions of the workflow and check last run. if not there try triggering it again.

    see if something is failing there?

  • irenegr Profile Picture
    irenegr 165 on at
    RE: Phone Call - Dynamically change activity's status

    I use 'change status'

  • Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Phone Call - Dynamically change activity's status

    Hi,

    Can you use Change status option instead of update record in workflow.

    Please mark my answer verified if i were helpful

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans