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 CRM (Archived)

Phone Call Direction

(0) ShareShare
ReportReport
Posted on by 2

Hi,

When we open a new Phone call, the direction is filled by default with outgoing, and the call from is the current user.

When I change the direction to Incoming, I would expect that call from to become empty and the call to to be filled with the current user.

However, changing direction, doesn't swithc the participants.

I tried with some javascript, but if either call from or call to is not filled, it gives an error.

Does somebody have a solution for this issue?

We are working on crm 2016 v8.2.2 on premise.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hey there,

    that's strange.

    1. it works fine in dynamics crm 365 online - like on changing the direction it switches the from and to and also in dynamics 2016 onprem - which i am working on.

    2. you can change the default value of the direction field from field properties and see what happens.

    first thing you should do is understand why OOTB functionality is not working - see if there are any Business rule/javascript isnt already there.

    finally post the error - will have a look on that which are getting in your javascript.

  • Birgit RD Profile Picture
    2 on at

    I changed the default value of the direction, and the result is the same: nothing happens when the direction is changed.

    However while debugging the javascript, I noticed that it looks like behind the scen it did switch the values: Xrm.Page.getAttribute("to").getValue() gives me what I expect, and not what I see on the screen.

    The javascript works fine the first couple of times the direction changes (put in the OnChange event), but after a few times it says it cannot get the value of undefined. Yhis implies that Xrm.Page.getAttribute("to") or Xrm.Page.getAttribute("from") becomes undefined at one point in time. Check on null is done, but not on undefined.

    Still at loss why it doesn't work OOB. One assumption is/was that it is originally made in 2011 and imported (via 2013-2015). But the buiilt-in form Phone Call has exactly the same issue. This does not have any business rules, javascript, workflow or whatsoever interfering.

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hey, Okay understood.

    you can may be take help from MS on understand why this OOB behavior is not working.

    for the javascript issue - silly suggestion -  i hope you are settings the lookup fine/correctly. because its a party list.

    rawishblog.wordpress.com/.../how-to-retrieve-lookup-value-and-set-it-on-another-lookup-field-in-dynamics-crm-2016-javascript

    rawishblog.wordpress.com/.../how-to-set-partylist-in-microsoft-dynamics-crm-using-javascript

  • Birgit RD Profile Picture
    2 on at

    Lookup is being set correctly.

    For the moment, I have to work on another project, so I haven't looked inot it any more.

  • Verified answer
    Community Member Profile Picture
    on at

    Hello,

    I have had the same issue and looked into a temp fix with some scripting.

    This worked for me...pieces taken from various posts.

    If Outgoing, I want the FROM field to have the current user

    If InComing, I want the TO field to have the current user

    So, create a new .js file with this function in it:

    function SwapIncomingOutgoingUser(control)

    {

       //get direction of call

       var direction = control.getEventSource().getValue();

       //get current user name and ID

       var userId = Xrm.Page.context.getUserId()

       var userName = Xrm.Page.context.getUserName();

       var partylistarray = [];

       partylistarray[0] = {};

       partylistarray[0].id = userId;

       partylistarray[0].name = userName;

       partylistarray[0].entityType = "systemuser";

    //NOTE: you might need to change the entityType to that which is being looked up... eg: account or contact

       if (direction == 1)

       {

           Xrm.Page.getAttribute("to").setValue(partylistarray);

           Xrm.Page.getAttribute("from").setValue(null);

       }

       else

       {

           Xrm.Page.getAttribute("from").setValue(partylistarray);

           Xrm.Page.getAttribute("to").setValue(null);

       }

    }

    Load that into the form with any other scriptfiles that are also being loaded.

    In the OnChange event on the Direction field/control, reference the method [SwapIncomingOutgoingUser] in your .js file and be sure to check the box: Pass execution context as first parameter.

    Save and publish and try adding a phonecall and it ought to work...

    Bear in mind, MS are supposed to be issuing an update as it is a known error but this is a work-around for now.

    Hope that helps!

  • Birgit RD Profile Picture
    2 on at

    Thanks. I could figure out what I was doing wrong based on your code.

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans