I am learning to code. Please excuse any mistakes I made in terminology.
I changed the code from crmForm to Xrm and it worked with one form but not with another. They are identical but I cannot seem to find the problem. Here is the beginning of my code, possibly where the error is.
old code:
/* Enable/Disable form fields based on Payment Type */
function set_paymenttype() {
switch (crmForm.all.new_paymenttype_optionset.DataValue)
new code:
/* Enable/Disable form fields based on Payment Type */
function set_paymenttype() {
switch (Xrm.Page.getAttribute("new_paymenttype_optionset").getValue()){
I get the following error message on opening the form.
The was an error with this field's customized event
Field:window
Event:onload
Error:'set_paymenttype' is undefined
Followed by:
The was an error with this field's customized event
Field:crmForm
Event:onsave
Error:'Form_onsave' is undefined.
Here is the updated code for 'Form_onsave'
function Form_onsave() {
Xrm.Page.getAttribute("new_totalleasepayment").setSubmitMode("always");
Xrm.Page.getAttribute("new_estsaleprofit.setSubmitMode("always");
Xrm.Page.getAttribute("new_estsaleprofitmargin.setSubmitMode("always"); }
Here are the Event Handlers properties for both events.
Let me know if you need any more information. The rest of the code is not every long. I can upload it if necessary.
Thank you for any assistance in this matter.