AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
CRM
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск Все разделы прочитаны

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.11.2017, 06:14   #1  
Blog bot is offline
Blog bot
Участник
 
25,459 / 846 (79) +++++++
Регистрация: 28.10.2006
crmtipoftheday: Tip #1032: Be careful with those function names
Источник: https://crmtipoftheday.com/1032/be-c...unction-names/
==============

Today’s tip is from Tom Pickles – thank you! And, hey, you can be a guest tipster too – just send your tip to jar@crmtipoftheday.com.

I fixed a curious issue today that I thought I’d share. Users had reported that when using the multi-edit form to update multiple cases, the form would freeze when they save, and never close. The records were updated, but you’d have to force refresh the browser window to continue.

After some digging, I found that this only happened when the script containing all our custom case form functions was loaded on the form. The curious thing was that the error occurred even when no functions were being called on the form, so it was purely the presence of the script that was causing the issue.

So what gives? A script sitting there doing nothing should cause no issues. It wasn’t until I started commenting out large chunks to narrow down the problem, that I hit upon the answer… a custom function named “closeWindow”.

As soon as I changed the name of this function, all started working as normal. I can only imagine that there is an internal function called “closeWindow”, which is called when closing the multi-edit form specifically. Instead of calling that, it was trying to run our one, which doesn’t work in that context.

So I guess the moral of the story is to be careful with those function names! Who knows what could be calling it…

Tîpp Jäår

Well, well, well… It sounds like a good case of spießrutenlaufen here! I truly hope that Tom either didn’t write those functions or that he did learn his lesson. Jason “I can make a kettle talk to CRM” Lattimer forewarned us about the importance of the namespaces in Javascript, like, uhm, 5 years ago but it’s never late to be reminded again!

Photo by Samuel Zeller on Unsplash



Источник: https://crmtipoftheday.com/1032/be-c...unction-names/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crmtipoftheday: Tip #1019: Understand decimal precision in Dynamics 365 Blog bot Dynamics CRM: Blogs 0 09.11.2017 08:14
crmtipoftheday: Tip #1018: Automatically create Dynamics 365 records from Social Engagement Blog bot Dynamics CRM: Blogs 0 08.11.2017 18:11
crmtipoftheday: Tip #1007: What is the Common Data Service (CDS) today? Blog bot Dynamics CRM: Blogs 0 23.10.2017 19:12
CRM DE LA CREME! Some useful CRMform jscripts Blog bot Dynamics CRM: Blogs 0 02.09.2009 10:05
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 13:33.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.