Im trying to retrieve a value from a quick view form of a related entity and trying to set a hidden field on this form so I can use the value to send out an email. I have got the below code so far, but have been unable to get it to work. New to this so any help is appreciated.
function getEmail(){
if (Xrm.Page.getControl('QuickviewControl1611244448861_QuickviewControl1611244448861_associateavailability_email') != null)
{
var emailQuickForm = Xrm.Page.getControl('QuickviewControl1611244448861_QuickviewControl1611244448861_associateavailability_email');
var email = emailQuickForm.getAttribute().getValue();
//set email on parent form
var newEmail = Xrm.Page.getAttribute("email").setValue(email);
console.log(newEmail);
}
else{
return null;
}
}
I should add that this is runs on the "onSave" event of the record.
question from:
https://stackoverflow.com/questions/65921494/get-set-values-javascript-quick-view-form-dynamics 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…