web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Form scripting error

(0) ShareShare
ReportReport
Posted on by

On our Account and Contact entities we have an 'Address Block' field. This field is an aggregate of the individual address fields and at the Contact level is populated and made read only by a JScript web resource. Recently I created a new state field on Contacts so we could map the state values from Accounts to Contacts when we create new ones. The old field didn't have the same values as the state field at the Account level. Now I get the following error anytime we try to save or change individual address fields on an Account.

This happens when trying to change the existing value of an Accounts state field:

Account_5F00_onchange.JPG 

This happens when trying to save the new value of an Accounts state field:Account_5F00_onsave.JPG

Any ideas what might be causing this or how I could diagnose the source of the issue?

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    tw0sh3ds Profile Picture
    5,600 on at

    It clearily states that you have a custom Javascript for "OnChange" event of your "tpr_state" field (I believe the same logic is run when you save the form). Post a code of this logic, otherwise it's hard to help you.

    But using my telepathic powers, I bet that you are doing some Xrm.Page.getAttribute("attributename") on a field that simply does not exist on the form and later you are calling getSelectedOption for this which is throwing this exception.

  • Community Member Profile Picture
    on at

    Yes, if I could find the JScript I could post it but this is an old system and the webresources don't clearly point to which scripts could be involved.

    Is there a way find which customized event is being initiated outside of reviewing each JScript in the web resources library?

  • Verified answer
    tw0sh3ds Profile Picture
    5,600 on at

    Well you don't have to look through all WebResources - go to your form customization, open form properties and in Form Properties you will have all WebResources related to this form. Now you can check if something is bound to your OnSave event and OnChange event for specific field and it will point to specific WebResource that contains the function.

    0711775.Capture.PNG

  • Community Member Profile Picture
    on at

    That did it! It was a poorly name web resource that I'd overlooked, I just need to rename the field it was calling in the script.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans