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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 12.11.2021, 13:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
d365technext: Existing Index Changes D365FO
Источник: https://d365technext.blogspot.com/20...es-d365fo.html
==============



Change existing Index D365FO



As we all have a requirement in the past to perform the changes in the existing indexes, and as we know the customization is not allowed in the OOTB elements, so we couldn’t achieve this.



How we can achieve it?



In D365FO, we couldn’t delete or disable the existing index, but there is one way to achieve this.

We can disable the index on SQL level by using the SQL script even on prod.



Yes, you are reading correct, we can disable the index and it will not enable again during package deployment, please only disable the index not remove the index, otherwise, Microsoft classes will re-create the index during deployment.

Now you can create the new index as per your requirements and it will work properly and will not make any conflict with the existing index, because it is already in the disabled state.

How you can disable the index?



publicvoid disableIndex(str _tableName, str _indexName)

{

str sql;

Connection conn;

SqlStatementExecutePermission permission;

;



sql= strFmt("ALTER INDEX %1 ON %2 DISABLE;", _ indexName, _tableName);

// sql = ‘delete from custTable’;

permission = new SqlStatementExecutePermission(sql);

conn = new Connection();

permission = new SqlStatementExecutePermission(sql);

permission.assert();

conn.createStatement().executeUpdate(sql);

// the permissions needs to be reverted back to original condition.

CodeAccessPermission::revertAssert();



}




Important

Before applying the index, please perform the analysis on your existing data, might possible

you can face the issue.



Источник: https://d365technext.blogspot.com/20...es-d365fo.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
NAV Team: Table Information including Index information (Usage, Blocks and Reads) - Again Blog bot Dynamics CRM: Blogs 0 08.02.2012 15:01
Nav developer: Table Information including Index information (Usage, Blocks and Reads) Blog bot Dynamics CRM: Blogs 0 25.08.2009 22:34
Nav developer: Table Information including Index information (Usage, Blocks and Reads) Blog bot Dynamics CRM: Blogs 0 25.08.2009 19:34
NAV Team: Table Information including Index information (Usage, Blocks and Reads) Blog bot Dynamics CRM: Blogs 0 25.08.2009 18:09
Nav developer: SQL Query to show tables, their indexes and index usage Blog bot Dynamics CRM: Blogs 0 04.06.2009 17:11

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

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

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