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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 03.03.2016, 18:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Afna CRM: CRM 2016 Update lookup field bug
Источник: http://a-crm.blogspot.com/2016/03/cr...field-bug.html
==============

I encountered a strange behavior after upgrading on premise CRM 2015 to 2016 version.

In the account form after I set the value of the custom lookup field (lookup to custom Country entity) I got javascript error:


SCRIPT5007: Unable to get property 'trim' of undefined or null reference


After some hours of debugging I removed all javascript code. Then I copied the example from SDK, the error was still there.


Investigating the setValue method I discovered, that something like "internalOnChange" was called. I suspect this method was called because there are some filtered lists in the page that depend on the value of this field.


Long story short, there are two ways to fix this:


Method 1:
Go to Settings-Administration-System settings. All the way down at the end of the page enable "Use legacy form rendering".


This will definitely slow down form loading.


Method 2:
The code deep down in the out-of-the-box CRM javascript libraries the script wants to parse the attribute type, but it is not there. The value should be "lookup" and you should pass it in the object when calling setValue.


//Create the lookup value object
var lookupReference = [];
lookupReference[0] = {};
lookupReference[0].id = "{a0c68c89-9752-e311-93f9-00155d78043f}";
lookupReference[0].entityType = "new_entityname";
lookupReference[0].name = "Display name";

//Magic happens here
lookupReference[0].type = "lookup";

//Update the lookup field
Xrm.Page.getAttribute("new_entitynameid").setValue(lookupReference);





Источник: http://a-crm.blogspot.com/2016/03/cr...field-bug.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 17 Blog bot Dynamics CRM: Blogs 0 10.05.2014 06:30
Microsoft Dynamics CRM Team Blog: What’s new in the Lookup control with Microsoft Dynamics CRM 2013 Blog bot Dynamics CRM: Blogs 0 04.12.2013 04:13
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 13 Blog bot Dynamics CRM: Blogs 0 27.03.2013 22:12
crminthefield: Podcast and Overview: Microsoft Dynamics CRM 2011 Update Rollup 11 Blog bot Dynamics CRM: Blogs 0 06.10.2012 05:27
Microsoft Dynamics CRM Team Blog: Update Rollup 2 for Microsoft Dynamics CRM 4.0 - More Info Blog bot Dynamics CRM: Blogs 0 12.02.2009 13:05

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:43.