Wednesday, 3 September 2014

CRM2011 get_lookupStyle error onload for Phone Call activity

Been experiencing a strange issue where an error message would pop up on the Phone Call activity of CRM2011. Some background is we have a phone call tracking system that would trigger the Phone Call entity with a call reference and phone number whenever a call was ended. This has been working fine since CRM4.0 but I believe rollup 12+ either broke or changed the functionality slightly

The culprit seems to be the SwapLookups function SwapLookups( crmForm.all.from, crmForm.all.to )

To solve this I had to edit the Onload and Onchange events and rewrite the SwapLookups to use my own code,below the code should you need to do the same

function DirectionChange()
{
var tempwho = Xrm.Page.getAttribute("from").getValue();
Xrm.Page.getAttribute("from").setValue(null);
Xrm.Page.getAttribute("to").setValue(tempwho);
}

This replicates the functionality of Swaplookups partially,it stores the Sender field value,blanks it,then changes the recipient field value to this stored value (this is for incoming calls as CRM defaults to Outgoing)

No comments:

Post a Comment