locked
Issue on partylist value swapping on phone call entity RRS feed

  • Question

  • Hi,

    I am facing issue on displaying icon image of partylist on phone call entity. My requirement is like when ever direction of call incoming or out going will be changed, the value of sent and receiver pastelist should be changed. I have used below code and its not working properly to display the icon image however data is swapping correctly. Please help me out 

    Thanks a lot in advance

    Env. Details :

    Windows 2008R2

    Microsoft Dynamic CRM 2011 with rollup 18

    IE 11

    Observation :

    This issue started after updating rollup 18. Previously I was using rollup 11 and the code was working perfectly. 

    Code :

    function SetReceipentAndSenderPartyListOnchange() {
        //debugger;

        if (Xrm.Page.data.entity.attributes.get("directioncode").getValue() == 1) //outgoing
        {


            document.getElementById("to").setAttribute("lookuptypes", "2");
            document.getElementById("to").setAttribute("defaulttype", "2");
            document.getElementById("to").setAttribute("lookuptypeIcons", "/_imgs/ico_16_2.gif");
            document.getElementById("to").setAttribute("disableViewPicker", "1");
            document.getElementById("to").setAttribute("lookupstyle", "multi");

            document.getElementById("from").setAttribute("lookuptypes", "8");
            document.getElementById("from").setAttribute("defaulttype", "8");
            document.getElementById("from").setAttribute("lookuptypeIcons", "/_imgs/ico_16_8.gif");
            document.getElementById("from").setAttribute("disableViewPicker", "1");
            document.getElementById("from").setAttribute("lookupstyle", "single");
            try {

                if (!SwapLookups(document.getElementById("to"), document.getElementById("from"))) {
                    /* Unsuccessful swap-- restore the original incoming/outgoing direction. */
                    Xrm.Page.data.entity.attributes.get("directioncode").getValue() = !Xrm.Page.data.entity.attributes.get("directioncode").getValue();
                }
            }
            catch (e) {
                //alert("Field\u003a directioncode-Error\u003a " + e.description);
            }
            try {

                if (!SwapLookups(document.getElementById("from"), document.getElementById("to"))) {
                    /* Unsuccessful swap-- restore the original incoming/outgoing direction. */
                    Xrm.Page.data.entity.attributes.get("directioncode").getValue() = !Xrm.Page.data.entity.attributes.get("directioncode").getValue();
                }
            }
            catch (e) {
                //alert("Field\u003a directioncode-Error\u003a " + e.description);
            }



        }
        else if (Xrm.Page.data.entity.attributes.get("directioncode").getValue() == 0) {

        debugger;

            document.getElementById("from").setAttribute("lookuptypes", "2");
            document.getElementById("from").setAttribute("defaulttype", "2");
            document.getElementById("from").setAttribute("lookuptypeIcons", "/_imgs/ico_16_2.gif");
            document.getElementById("from").setAttribute("disableViewPicker", "1");
            document.getElementById("from").setAttribute("lookupstyle", "single");

            document.getElementById("to").setAttribute("lookuptypes", "8");
            document.getElementById("to").setAttribute("defaulttype", "8");
            document.getElementById("to").setAttribute("lookuptypeIcons", "/_imgs/ico_16_8.gif");
            document.getElementById("to").setAttribute("disableViewPicker", "1");
            document.getElementById("to").setAttribute("lookupstyle", "single");





        }

    }

    Regards,

    RK

            
    • Edited by Windshadow0047 Saturday, September 5, 2015 9:15 AM update observation
    Saturday, September 5, 2015 9:11 AM