Hi community,
I encountered an interesting error. I have a custom js library in the account entity. I added js function to phone field.
My js code :
function onChangeTelephone1(fieldname) { // PhoneNumber1 var phone = Xrm.Page.getAttribute("telephone1").getValue(); if (!phone) return true; var isSuccess = ControlPhoneForTurkey(phone,fieldname); return isSuccess; }
I added the function to onchange event but it didnt trigger.
I tried to fix the problem;
- I created a new library and moved the codes to this library.
- I opened the developer console by adding a debugger to the code, it didn't trigger.
- I confirmed that the library of the function I added to the onchange event of the phone number field on the form is correct.
Despite all this, I could not trigger the code somehow. Moreover, this development was working without any problems 2 days ago.
I shared screenshots:
1- Error details (web resources does not contain)
2- OnChange event and library information
The browser does not enter debug mode even though I have made changes to the field.
Could you please help me ?
Thanks in advance.
Regards.
Hi Arshad,
It's actually my cache clear. All I skipped was try from a different browser :/ I tried different browser. It was successed. Thank you very much everyone.
Hi Bipin,
I checked to js code in esprima website. There isn't any error. Validation successed
I'm pretty sure I published the code anyway I just re-published it and the problem didn't change.
Hi Amit,
Of course I confirmed, It is not possible to choose from the event area without the library anyway.
Hi,
I have copy same your code in my trail crm. it is working fine. i have given the debugger as well on the phone number change. Please find the below screenshot for your reference.
Please try to clear you cache memory and try again it will be work.
Thanks,
Arsahd
Please like and subscribe my youtube channel and follow my blog as well for interview preparation and more update please.
https://www.youtube.com/channel/UC3Pe9Y_2SxA9xAmTfuSWQaA/videos
Hi,
Make sure web resource library has correct js syntax. Validate using below online tool
Also, I hope you have published your customization.
Hello ,
Can you confirm that the given function is present in the Selected library?
Thank you,
Amit katariya
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156