Scenario:
Step 1: Am using MS CRM 2011.I write the javascript Function For Get the To Field Value(Email Entity) and set that Value into Regarding Field.It was Working Fine.
Step 2: Write the Process for Update the value in Regarding Field as clear.Because automatically the regarding Field Get some Value.So I need to change that as empty in Regarding field.It was Working fine.
Step 3: now I call the the javascript Function in onchange Event.
Problem: The Regarding Field value Get clear after the process Execute.which means the old value replace and new value get in the Regarding Field.It is Like a on change Event.The old value replaced as a Empty.
But the Function not trigger.If open the email form and change the regarding Field,It was working Fine which means the Javascript can work.
summary: The onchange event didnt not call when I change the value from Process.But I trying manually the javascript working Fine.
How to solve this problem.
**Refer the Following Screen Shots:
Using this Java Script:
Step 1 Coding function TofieldValuetoOtherField() {
var lookup = new Array();
lookup = Xrm.Page.getAttribute("to").getValue();
if (lookup != null)
{
var name = lookup[0].name;
var id = lookup[0].id;
var entityType = lookup[0].entityType;
Xrm.Page.getAttribute("regardingobjectid").setValue([{ id: id, name: name, entityType: entityType }]);
//Xrm.Page.data.entity.save();
}}
Call the Onchange like this Its not Fired.