Hi All,
I have a CRM Form in which there are multiple fields and notes entity is also enabled. Now what i want to achieve is if i change one of the field on the form and notes is not attached then I will have to alert and display a message and once i attach notes on the form it should not display any message.
My Implementation :
I have written a simple JS Script in onload event which I am getting the value of the required field like below :
citizenshipstatus is a Optionset Field
Function is :
checkCitizenshipStatusChangeMaritalStatusChange: function () {
var CSS = Xrm.Page.getAttribute("citizenshipstatus").getValue();
//var MS = Xrm.Page.getAttribute("maritalstatus").getValue();
var notesLength = document.getElementById("notescontrol").contentWindow.document.getElementById("NotesTab").children[1].children[4].children.length;
currently with the above highlighted code i am not getting the Notes attachment
if (CSS && !notesLength)
{
Xrm.Page.ui.setFormNotification('Please attach document(s) in Notes section if Citizenship Status is changed.', 'WARNING');
alert("Please attach document(s) in Notes section if Citizenship Status is changed.");
}
}
Can anyone please help me in this. I just want to know how is the notes fetched in Javascript?
*This post is locked for comments