{"id":1503,"date":"2019-04-03T22:12:02","date_gmt":"2019-04-03T20:12:02","guid":{"rendered":"https:\/\/d365bc.info.pl\/?p=1503"},"modified":"2019-04-03T22:12:19","modified_gmt":"2019-04-03T20:12:19","slug":"dlaczego-nie-powinienes-tworzyc-extensions","status":"publish","type":"post","link":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/","title":{"rendered":"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central?"},"content":{"rendered":"\n<p>Obecnie chc\u0105c rozszerzy\u0107 funkcjonalno\u015b\u0107 Dynamics 365 Business Central modyfikujesz standardowe obiekty w Development Environment. Niemniej od jesieni czekaj\u0105 Ci\u0119 spore zmiany, na Directions ASIA Microsoft zapowiedzia\u0142, \u017ce wraz z kolejn\u0105 edycj\u0105 nie b\u0119dzie ju\u017c Development Environment, ani klienta RTC. Pozostanie Ci korzystanie z Visual Studio Code i nowoczesnych klient\u00f3w opartych o technologi\u0119 WEB. Co gorsza czeka Ci\u0119 tak\u017ce niespodzianka w postaci przekonwertowanej aplikacji do poziomu Extension. Wierz\u0105c w to co m\u00f3wi Microsoft powinni\u015bmy mie\u0107 dost\u0119p do kod\u00f3w \u017ar\u00f3d\u0142owych. Niemniej poruszanie si\u0119 w tylu obiektach z poziomu VS Code mo\u017ce nie by\u0107 przyjemne. Nie oszukujmy si\u0119, nie jest to \u015brodowisko tak przyjazne jak stary poczciwy Development Environment, kt\u00f3ry by\u0142 dedykowany Dynamics NAV w\u0142a\u015bnie. Mo\u017ce to wymusza\u0107 tworzenie mniejszych Extensions celem dostosowania systemu, zamiast modyfikacji przepastnych kod\u00f3w \u017ar\u00f3d\u0142owych systemu. Tutaj czaj\u0105 si\u0119 dwie pu\u0142apki o kt\u00f3rych ma\u0142o kto wspomina\u2026<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3 class=\"wp-block-heading\">Pu\u0142apka nr 1 \u2013 modyfikacja zachowania systemu<\/h3>\n\n\n\n<p>Tworz\u0105c Extension \u2013 mo\u017cemy rozszerza\u0107 dzia\u0142anie systemu, ale nie mo\u017cemy modyfikowa\u0107 jego standardowych mechanizm\u00f3w. Je\u017celi MS napisze co\u015b co Ci si\u0119 nie podoba u\u017cywaj\u0105c Extension nie zmodyfikujesz ich kodu oraz nie wy\u0142\u0105czysz go. Przyk\u0142adem niech b\u0119dzie komunikat dodany w kt\u00f3rej\u015b z wersji \u2013 \u201eZam\u00f3wienie nie zosta\u0142o zrealizowane, czy na pewno chcesz je zamkn\u0105\u0107?\u201d (teraz komunika mo\u017cna ju\u017c wy\u0142\u0105czy\u0107 w ustawieniach). B\u0142ahy komunikat spowodowa\u0142, \u017ce tysi\u0105ce (jak nie setki tysi\u0119cy) u\u017cytkownik\u00f3w musia\u0142y bezsensownie dzie\u0144 w dzie\u0144 klika\u0107 potwierdzenie oczywistej dla nich akcji. Sam w wielu firmach wy\u0142\u0105cza\u0142em ten komunikat \u2013 ale mo\u017cliwo\u015b\u0107 tak\u0105 dawa\u0142a tylko ingerencja w kod \u017ar\u00f3d\u0142owy systemu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Pu\u0142apka nr 2 \u2013 wydajno\u015b\u0107<\/h3>\n\n\n\n<p>Tutaj zaczyna si\u0119 prawdziwy problem z Extensions, kt\u00f3ry oddzia\u0142uje na dw\u00f3ch poziomach. Pierwszym jest obs\u0142uga zdarze\u0144 zamiast ci\u0105g\u0142o\u015b\u0107 kodu. Jak si\u0119 pewnie domy\u015blasz trudno aby oba te podej\u015bcia by\u0142y tak samo wydajne je\u017celi chodzi o obs\u0142ug\u0119 transakcji bazodanowych. Drugi problem postaram Ci si\u0119 uzmys\u0142owi\u0107 na przyk\u0142adzie. Za\u0142\u00f3\u017cmy, \u017ce zaczynasz wdro\u017cenie i w celu raportowania musisz doda\u0107 pole do zapis\u00f3w ksi\u0119gi g\u0142\u00f3wnej. My\u015bl\u0119, \u017ce przyk\u0142ad ten nie jest niczym nadzwyczajnym, ale r\u00f3wnie dobrze tyczy si\u0119 dodania ka\u017cdego pola do dowolnej tabeli, kt\u00f3re b\u0119dzie p\u00f3\u017aniej wykorzystywane do filtrowania b\u0105d\u017a wyliczania danych. Jako programista masz ju\u017c dzi\u015b mo\u017cliwo\u015b\u0107 aby zrobi\u0107 to dwojako \u2013 modyfikuj\u0105c standardowo tabel\u0119 G\/L Entry, b\u0105d\u017a tworz\u0105 Extension rozszerzaj\u0105ce t\u0105 tabel\u0119 o nowe pole. Prze\u015bled\u017amy teraz oba scenariusze, dla wygody zrobi\u0119 to jednak nie na G\/L Entry a na nowej tabeli zapis\u00f3w, kt\u00f3r\u0105 wcze\u015bniej utworzy\u0142em (jako pierwsze Extension).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Krok 1 \u2013 dodajemy nowe pole modyfikuj\u0105c obiekt<\/h3>\n\n\n\n<p>Do test\u00f3w utworzy\u0142em tabel\u0119 \u201cTest Entry Table\u201d tabela ta jest bardzo prosta, a dodane pole symbolizuje \u201eTest Field 1\u201d. P\u00f3\u017aniej dodamy analogiczne pole z tym, \u017ce za pomoc\u0105 Extension.<\/p>\n\n\n<div class=\"codecolorer-container c blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;height:300px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/>20<br \/>21<br \/>22<br \/>23<br \/>24<br \/>25<br \/>26<br \/>27<br \/>28<br \/>29<br \/>30<br \/>31<br \/>32<br \/>33<br \/>34<br \/>35<br \/>36<br \/>37<br \/>38<br \/>39<br \/>40<br \/>41<br \/>42<br \/>43<br \/>44<br \/>45<br \/>46<br \/>47<br \/>48<br \/>49<br \/>50<br \/>51<br \/>52<br \/>53<br \/>54<br \/><\/div><\/td><td><div class=\"c codecolorer\">table <span class=\"nu0\">50100<\/span> <span class=\"st0\">&quot;Test Entry Table&quot;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; fields<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">1<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Entry No.&quot;<\/span><span class=\"sy0\">;<\/span> Integer<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Entry No.'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">2<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">;<\/span> Date<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Posting Date'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">3<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Customer No.&quot;<\/span><span class=\"sy0\">;<\/span> Code<span class=\"br0\">&#91;<\/span><span class=\"nu0\">20<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Customer No.'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TableRelation <span class=\"sy0\">=<\/span> Customer<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">4<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Amount&quot;<\/span><span class=\"sy0\">;<\/span> Decimal<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Amount'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">50000<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"sy0\">;<\/span> Code<span class=\"br0\">&#91;<\/span><span class=\"nu0\">10<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Test Field 1'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; keys<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; key<span class=\"br0\">&#40;<\/span>PK<span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Entry No.&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Clustered <span class=\"sy0\">=<\/span> <span class=\"kw2\">true<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; key<span class=\"br0\">&#40;<\/span>PostingDate<span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SumIndexFields <span class=\"sy0\">=<\/span> Amount<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; key<span class=\"br0\">&#40;<\/span>PostingDateTestField<span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SumIndexFields <span class=\"sy0\">=<\/span> Amount<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; key<span class=\"br0\">&#40;<\/span>TestFieldKey<span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SumIndexFields <span class=\"sy0\">=<\/span> Amount<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>Poza polami zdefiniowa\u0142em klucze wraz z SumIndexFields. Wa\u017cnym jest, \u017ce dodaj\u0105c pole do tabeli w ten spos\u00f3b mam mo\u017cliwo\u015b\u0107 zdefiniowania kluczy sk\u0142adaj\u0105cych si\u0119 z istniej\u0105cych i nowo dodanych p\u00f3l. <strong>Brak jest tej mo\u017cliwo\u015b\u0107 w przypadku Extension, ale o tym za chwil\u0119.<\/strong><\/p>\n\n\n\n<p>Nasza nowa tabela prezentuje si\u0119 nast\u0119puj\u0105co:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"557\" height=\"305\" data-attachment-id=\"1511\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/business-central-table-in-sql\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?fit=557%2C305&amp;ssl=1\" data-orig-size=\"557,305\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Business Central Table in SQL\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?fit=300%2C164&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?fit=557%2C305&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?resize=557%2C305&#038;ssl=1\" alt=\"\" class=\"wp-image-1511\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?w=557&amp;ssl=1 557w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL.png?resize=300%2C164&amp;ssl=1 300w\" sizes=\"(max-width: 557px) 100vw, 557px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Krok 2 \u2013 dodajemy nowe pole tworz\u0105c Extension<\/h1>\n\n\n\n<p>Teraz dodamy analogiczne do poprzedniego kroku pole \u201eTest\nField 2\u201d, ale zrobimy to tworz\u0105c Extension do tabeli z poprzedniego kroku.<\/p>\n\n\n<div class=\"codecolorer-container c blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"c codecolorer\">tableextension <span class=\"nu0\">50100<\/span> <span class=\"st0\">&quot;Test Entry Table Ext&quot;<\/span> extends <span class=\"st0\">&quot;Test Entry Table&quot;<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; fields<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; field<span class=\"br0\">&#40;<\/span><span class=\"nu0\">50001<\/span><span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Test Field 2&quot;<\/span><span class=\"sy0\">;<\/span> Code<span class=\"br0\">&#91;<\/span><span class=\"nu0\">10<\/span><span class=\"br0\">&#93;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caption <span class=\"sy0\">=<\/span> <span class=\"st0\">'Test Field 2'<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DataClassification <span class=\"sy0\">=<\/span> OrganizationIdentifiableInformation<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; keys<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; key<span class=\"br0\">&#40;<\/span>NewKey<span class=\"sy0\">;<\/span> <span class=\"st0\">&quot;Test Field 2&quot;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>Po stronie Business Central widzimy to jako jedn\u0105 zgrabn\u0105 tabel\u0119, ale rzeczywisto\u015b\u0107 jest troch\u0119 inna.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1640\" height=\"416\" data-attachment-id=\"1512\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/business-central-table\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?fit=1640%2C416&amp;ssl=1\" data-orig-size=\"1640,416\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Business Central &#8211; Table\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?fit=300%2C76&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?fit=1024%2C260&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?fit=1024%2C260&amp;ssl=1\" alt=\"\" class=\"wp-image-1512\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?w=1640&amp;ssl=1 1640w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?resize=300%2C76&amp;ssl=1 300w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?resize=768%2C195&amp;ssl=1 768w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table.png?resize=1024%2C260&amp;ssl=1 1024w\" sizes=\"(max-width: 1110px) 100vw, 1110px\" \/><\/figure>\n\n\n\n<p>My\u015bl\u0119, \u017ce zdajesz sobie spraw\u0119 z tego, \u017ce ka\u017cde rozszerzenie przechowuje swoje dane w dedykowanych tabelach. Mimo wielu zalet rodzi to pewn\u0105 nieprzyjemn\u0105 konsekwencj\u0119. Teraz na nasz\u0105 tabel\u0119 sk\u0142adaj\u0105 si\u0119 dwie tabele (jedna z pierwszego \u2013 bazowego Extension i druga z rozszerzaj\u0105cego je nowego Extension). Niesie to za sob\u0105 powa\u017cne konsekwencja \u2013 brak mo\u017cliwo\u015bci definiowania kluczy i widok\u00f3w indeksowanych (SIFT) zawieraj\u0105cych wszystkie pola w tabeli. Ma to potencjalnie ogromny wp\u0142yw na rozwi\u0105zania, kt\u00f3re b\u0119dziesz tworzy\u0107.<\/p>\n\n\n\n<p>Oto jak wygl\u0105daj\u0105 tabele z poziomu SQL Management Studio:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"621\" height=\"522\" data-attachment-id=\"1513\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/business-central-table-in-sql-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?fit=621%2C522&amp;ssl=1\" data-orig-size=\"621,522\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Business Central Table in SQL 2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?fit=300%2C252&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?fit=621%2C522&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?resize=621%2C522&#038;ssl=1\" alt=\"\" class=\"wp-image-1513\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?w=621&amp;ssl=1 621w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Business-Central-Table-in-SQL-2.png?resize=300%2C252&amp;ssl=1 300w\" sizes=\"(max-width: 621px) 100vw, 621px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\">Krok 3 \u2013 Test wydajno\u015bci<\/h1>\n\n\n\n<p>Chcia\u0142bym teraz pokaza\u0107 Ci jak wielki problem powoduje\ndodanie nowego pola do tabeli za pomoc\u0105 Extension. Por\u00f3wnajmy dwa fragmenty kodu:<\/p>\n\n\n<div class=\"codecolorer-container c blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"c codecolorer\">TestEntry.<span class=\"me1\">reset<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetCurrentKey<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetRange<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">,<\/span> PostingDate<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetRange<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">'001'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">CalcSums<\/span><span class=\"br0\">&#40;<\/span>Amount<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>oraz<\/p>\n\n\n<div class=\"codecolorer-container c blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"c codecolorer\">TestEntry.<span class=\"me1\">reset<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetCurrentKey<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">&quot;Test Field 2&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetRange<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">,<\/span> PostingDate<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">SetRange<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Test Field 2&quot;<\/span><span class=\"sy0\">,<\/span> <span class=\"st0\">'901'<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\nTestEntry.<span class=\"me1\">CalcSums<\/span><span class=\"br0\">&#40;<\/span>Amount<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>Te dwa fragmenty kodu s\u0105 identyczne, i maj\u0105 zrobi\u0107 dok\u0142adnie\nto samo \u2013 wyliczy\u0107 sum\u0119 pola Amount, w obu przypadkach korzystamy z filtorwania\npo prawie takich samych polach. Wielu programist\u00f3w b\u0119dzie spodziewa\u0142o si\u0119, \u017ce wydajno\u015b\u0107\nobu tych fragment\u00f3w b\u0119dzie identyczna, to jednak jest dalekie od prawdy.<\/p>\n\n\n\n<p><em>O dziwo w drugim\nprzypadku kompilator przyj\u0105\u0142 klucz \u201ePosting Date\u201d, \u201eTest Field 2\u201d \u2013 kt\u00f3ry nie\nistnieje, ale gdyby da\u0142o si\u0119 go stworzy\u0107 to by\u0142by on idealny do tej operacji. Tym\nrazem jednak zosta\u0142 on zignorowany przez kompilator i system.<\/em><\/p>\n\n\n\n<p>Po odpaleniu tych fragment\u00f3w kodu w Business Central i skorzystaniu z SQL Profilera sprawdzi\u0142em na jakie zapytania j\u0119zyka SQL konwertowane s\u0105 te instrukcje w obu przypadkach, oto rezultaty:<\/p>\n\n\n\n<p><strong>Zapytanie 1:<\/strong><\/p>\n\n\n<div class=\"codecolorer-container sql blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/><\/div><\/td><td><div class=\"sql codecolorer\"><span class=\"kw1\">SELECT<\/span> <span class=\"kw1\">SUM<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;SUM$Amount&quot;<\/span><span class=\"br0\">&#41;<\/span> <br \/>\n<span class=\"kw1\">FROM<\/span> <span class=\"st0\">&quot;CRONUS&quot;<\/span><span class=\"sy0\">.<\/span>dbo<span class=\"sy0\">.<\/span><span class=\"st0\">&quot;CRONUS International Ltd_$Test Entry Table$3ec26948-c0c0-4a0e-bf1b-76973cc297dd$VSIFT$PostingDateTestField&quot;<\/span> <span class=\"kw1\">WITH<\/span><span class=\"br0\">&#40;<\/span>READUNCOMMITTED<span class=\"sy0\">,<\/span>NOEXPAND<span class=\"br0\">&#41;<\/span> &nbsp;<br \/>\n<span class=\"kw1\">WHERE<\/span> <span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">'20200607'<\/span> <span class=\"kw1\">AND<\/span> <span class=\"st0\">&quot;Test Field 1&quot;<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">'001'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"kw1\">OPTION<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw1\">OPTIMIZE<\/span> <span class=\"kw1\">FOR<\/span> <span class=\"kw1\">UNKNOWN<\/span><span class=\"br0\">&#41;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p><strong>Zapytanie 2:<\/strong><\/p>\n\n\n<div class=\"codecolorer-container sql blackboard\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"sql codecolorer\"><span class=\"kw1\">SELECT<\/span> <span class=\"kw1\">SUM<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;50100&quot;<\/span><span class=\"sy0\">.<\/span><span class=\"st0\">&quot;Amount&quot;<\/span><span class=\"br0\">&#41;<\/span> <br \/>\n<span class=\"kw1\">FROM<\/span> <span class=\"st0\">&quot;CRONUS&quot;<\/span><span class=\"sy0\">.<\/span>dbo<span class=\"sy0\">.<\/span><span class=\"st0\">&quot;CRONUS International Ltd_$Test Entry Table$3ec26948-c0c0-4a0e-bf1b-76973cc297dd&quot;<\/span> <span class=\"st0\">&quot;50100&quot;<\/span> &nbsp;<span class=\"kw1\">WITH<\/span><span class=\"br0\">&#40;<\/span>READUNCOMMITTED<span class=\"br0\">&#41;<\/span> &nbsp;<br \/>\n<span class=\"kw1\">JOIN<\/span> <span class=\"st0\">&quot;CRONUS&quot;<\/span><span class=\"sy0\">.<\/span>dbo<span class=\"sy0\">.<\/span><span class=\"st0\">&quot;CRONUS International Ltd_$Test Entry Table$edde125d-9df7-4214-948c-2c8a1072a618&quot;<\/span> <span class=\"st0\">&quot;50100_e1&quot;<\/span> &nbsp;<span class=\"kw1\">WITH<\/span><span class=\"br0\">&#40;<\/span>READUNCOMMITTED<span class=\"br0\">&#41;<\/span> &nbsp;<br \/>\n<span class=\"kw1\">ON<\/span> <span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;50100&quot;<\/span><span class=\"sy0\">.<\/span><span class=\"st0\">&quot;Entry No_&quot;<\/span> <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;50100_e1&quot;<\/span><span class=\"sy0\">.<\/span><span class=\"st0\">&quot;Entry No_&quot;<\/span><span class=\"br0\">&#41;<\/span> <br \/>\n<span class=\"kw1\">WHERE<\/span> <span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;50100&quot;<\/span><span class=\"sy0\">.<\/span><span class=\"st0\">&quot;Posting Date&quot;<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">'20200607'<\/span> <span class=\"kw1\">AND<\/span> <span class=\"st0\">&quot;50100_e1&quot;<\/span><span class=\"sy0\">.<\/span><span class=\"st0\">&quot;Test Field 2&quot;<\/span><span class=\"sy0\">=<\/span><span class=\"st0\">'901'<\/span><span class=\"br0\">&#41;<\/span> <span class=\"kw1\">OPTION<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw1\">OPTIMIZE<\/span> <span class=\"kw1\">FOR<\/span> <span class=\"kw1\">UNKNOWN<\/span><span class=\"br0\">&#41;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n\n\n\n<p>Jak wida\u0107 pierwsze zapytanie korzysta z technologii SIFT do\nszybkiego wyliczenia sumy, wynika to z faktu, i\u017c by\u0142a mo\u017cliwo\u015b\u0107 zdefiniowania odpowiedniego\nklucza z warto\u015bci\u0105 SumIndexFields. Drugie zapytanie to co\u015b z go\u0142a innego. Jest\nto JOIN dw\u00f3ch tabel, wystarczy spojrze\u0107 na por\u00f3wnanie wykonania obu zapyta\u0144:<\/p>\n\n\n\n<p><strong>Zapytanie 1:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"86\" data-attachment-id=\"1514\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/query-plan-1\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?fit=537%2C86&amp;ssl=1\" data-orig-size=\"537,86\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Query Plan 1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?fit=300%2C48&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?fit=537%2C86&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?resize=537%2C86&#038;ssl=1\" alt=\"\" class=\"wp-image-1514\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?w=537&amp;ssl=1 537w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-1.png?resize=300%2C48&amp;ssl=1 300w\" sizes=\"(max-width: 537px) 100vw, 537px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color\">Table &#8216;CRONUS International Ltd_$Test\nEntry Table$3ec26948-c0c0-4a0e-bf1b-76973cc297dd$VSIFT$PostingDateTestField&#8217;.\nScan count 0, logical reads 2, physical reads 2, read-ahead reads 0, lob\nlogical reads 0, lob physical reads 0, lob read-ahead reads 0.<\/p>\n\n\n\n<p><strong>Zapytanie 2:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"152\" data-attachment-id=\"1515\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/query-plan-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?fit=667%2C152&amp;ssl=1\" data-orig-size=\"667,152\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Query Plan 2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?fit=300%2C68&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?fit=667%2C152&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?resize=667%2C152&#038;ssl=1\" alt=\"\" class=\"wp-image-1515\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?w=667&amp;ssl=1 667w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/Query-Plan-2.png?resize=300%2C68&amp;ssl=1 300w\" sizes=\"(max-width: 667px) 100vw, 667px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color\">Table &#8216;CRONUS International Ltd_$Test\nEntry Table$3ec26948-c0c0-4a0e-bf1b-76973cc297dd&#8217;. Scan count 1, logical reads\n2746, physical reads 3, read-ahead reads 2729, lob logical reads 0, lob physical\nreads 0, lob read-ahead reads 0.<\/p>\n\n\n\n<p class=\"has-background has-very-light-gray-background-color\">Table &#8216;CRONUS International Ltd_$Test\nEntry Table$edde125d-9df7-4214-948c-2c8a1072a618&#8217;. Scan count 1, logical reads\n101, physical reads 2, read-ahead reads 248, lob logical reads 0, lob physical\nreads 0, lob read-ahead reads 0.<\/p>\n\n\n\n<p><strong>Zapytnie 1 vs. Zapytanie 2<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"591\" height=\"217\" data-attachment-id=\"1516\" data-permalink=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/query-1-vs-query-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?fit=591%2C217&amp;ssl=1\" data-orig-size=\"591,217\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"query 1 vs query 2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?fit=300%2C110&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?fit=591%2C217&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?resize=591%2C217&#038;ssl=1\" alt=\"\" class=\"wp-image-1516\" srcset=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?w=591&amp;ssl=1 591w, https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/query-1-vs-query-2.png?resize=300%2C110&amp;ssl=1 300w\" sizes=\"(max-width: 591px) 100vw, 591px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p><em>Dodam, \u017ce przed ka\u017cdym\nwywo\u0142aniem danego zapytania czyszczone by\u0142y dane w cache SQLa.<\/em><\/p>\n\n\n\n<p>Patrz\u0105c na powy\u017csze obrazki nawet niewtajemniczone osoby\npowinny zauwa\u017cy\u0107, \u017ce pierwsze zapytanie by\u0142o optymalne i bardzo szybkie, a\ndrugie by\u0142o jego przeciwie\u0144stwem. R\u00f3\u017cnica czas\u00f3w trwania to 15 do 147, czyli nieomal\u017ce\ndziesi\u0119ciokrotno\u015b\u0107. Wynika to z braku mo\u017cliwo\u015bci skorzystania z odpowiednich\nkluczy i widok\u00f3w indeksowanych.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">Podsumowanie<\/h1>\n\n\n\n<p>Mimo, \u017ce jestem entuzjast\u0105 obecnych zmian, uwielbiam Visual Studio Code, Extension, Gita i ca\u0142\u0105 reszt\u0119 udogodnie\u0144, to ci\u0105gle z obawami patrz\u0119 w przysz\u0142o\u015b\u0107. Powod\u00f3w jest wiele, ale nie w tym rzecz, bo wpis ten mia\u0142 tak naprawd\u0119 na celu u\u015bwiadomienie Ci faktu, \u017ce nie zawsze tworzenie Extension b\u0119dzie najlepszym wyj\u015bciem. Business Central doskonale sprawdza si\u0119 tak\u017ce w du\u017cych wysokowydajnych wdro\u017ceniach, ale dzieje si\u0119 tak ze wzgl\u0119du na mo\u017cliwo\u015b\u0107 modyfikacji standardowego kodu systemu. Dynamics NAV by\u0142 najlepsz\u0105 platform\u0105 biznesow\u0105 \u2013 nie ze wzgl\u0119du na swoje funkcje \u2013 ale ze wzgl\u0119du na mo\u017cliwo\u015b\u0107 ich modyfikacji. Potencja\u0142 by\u0142 naprawd\u0119 spory, zw\u0142aszcza je\u017celi chodzi o popraw\u0119 wydajno\u015bci i modelowanie proces\u00f3w biznesowych. Dop\u00f3ki mamy dost\u0119p do kod\u00f3w \u017ar\u00f3d\u0142owych i Business Central w wersji on-Premis mo\u017cemy spa\u0107 spokojnie, ale boj\u0119 si\u0119, \u017ce nadejdzie dzie\u0144 w kt\u00f3rym Microsoft zabierze nam t\u0119 mo\u017cliwo\u015b\u0107, a partnerzy zostan\u0105 sprowadzenie do roli handlowc\u00f3w oferuj\u0105cych Business Central w chmurze. Nie wiem na ile Microsoft zdaje sobie spraw\u0119 z tego co by\u0142o najmocniejsz\u0105 stron\u0105 Dynamics NAV, ale na pewno nie chodzi\u0142o tutaj o mo\u017cliwo\u015b\u0107 tworzenia nowych funkcji. Tak\u017ce zanim zdecydujesz si\u0119 na wdro\u017cenie danej funkcji poprzez tworzenie Extension upewnij si\u0119, \u017ce nie jest ona newralgiczna z punktu widzenia wydajno\u015bci ca\u0142ego systemu i proces\u00f3w biznesowych klienta.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Obecnie chc\u0105c rozszerzy\u0107 funkcjonalno\u015b\u0107 Dynamics 365 Business Central modyfikujesz standardowe obiekty w Development Environment. Niemniej od jesieni czekaj\u0105 Ci\u0119 spore zmiany, na Directions ASIA Microsoft zapowiedzia\u0142, \u017ce wraz z kolejn\u0105 edycj\u0105 nie b\u0119dzie ju\u017c Development Environment, ani klienta RTC. Pozostanie Ci korzystanie z Visual Studio Code i nowoczesnych klient\u00f3w opartych o technologi\u0119 WEB. Co gorsza<\/p>\n<p><span class=\"xf__dots\">&#8230;<\/span><a class=\"xf__more xf__button\" href=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":1518,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[127,128,13,15,14],"tags":[137,133,129,138,125,76,124],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:locale:alternate\" content=\"pl_PL\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central\" \/>\n<meta property=\"og:description\" content=\"Obecnie chc\u0105c rozszerzy\u0107 funkcjonalno\u015b\u0107 Dynamics 365 Business Central modyfikujesz standardowe obiekty w Development Environment. Niemniej od jesieni czekaj\u0105 Ci\u0119 spore zmiany, na Directions ASIA Microsoft zapowiedzia\u0142, \u017ce wraz z kolejn\u0105 edycj\u0105 nie b\u0119dzie ju\u017c Development Environment, ani klienta RTC. Pozostanie Ci korzystanie z Visual Studio Code i nowoczesnych klient\u00f3w opartych o technologi\u0119 WEB. Co gorsza...Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog o Microsoft Dynamics 365 Business Central\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-03T20:12:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-03T20:12:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1918\" \/>\n\t<meta property=\"og:image:height\" content=\"952\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"rafal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rbabaczyk\" \/>\n<meta name=\"twitter:site\" content=\"@rbabaczyk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rafal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\",\"url\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\",\"name\":\"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central\",\"isPartOf\":{\"@id\":\"https:\/\/d365bc.info.pl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1\",\"datePublished\":\"2019-04-03T20:12:02+00:00\",\"dateModified\":\"2019-04-03T20:12:19+00:00\",\"author\":{\"@id\":\"https:\/\/d365bc.info.pl\/#\/schema\/person\/f5cb8e045a4a97815cd6e40491adefad\"},\"breadcrumb\":{\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1\",\"width\":1918,\"height\":952},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Strona g\u0142\u00f3wna\",\"item\":\"https:\/\/d365bc.info.pl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/d365bc.info.pl\/#website\",\"url\":\"https:\/\/d365bc.info.pl\/\",\"name\":\"Blog o Microsoft Dynamics 365 Business Central\",\"description\":\"Polski blog o Microsoft Dynamics 365 Business Central (dawniej Dynamics NAV)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/d365bc.info.pl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/d365bc.info.pl\/#\/schema\/person\/f5cb8e045a4a97815cd6e40491adefad\",\"name\":\"rafal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/d365bc.info.pl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/76728b0891ff455b2cb63205ba51106e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/76728b0891ff455b2cb63205ba51106e?s=96&d=mm&r=g\",\"caption\":\"rafal\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/","og_locale":"en_US","og_type":"article","og_title":"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central","og_description":"Obecnie chc\u0105c rozszerzy\u0107 funkcjonalno\u015b\u0107 Dynamics 365 Business Central modyfikujesz standardowe obiekty w Development Environment. Niemniej od jesieni czekaj\u0105 Ci\u0119 spore zmiany, na Directions ASIA Microsoft zapowiedzia\u0142, \u017ce wraz z kolejn\u0105 edycj\u0105 nie b\u0119dzie ju\u017c Development Environment, ani klienta RTC. Pozostanie Ci korzystanie z Visual Studio Code i nowoczesnych klient\u00f3w opartych o technologi\u0119 WEB. Co gorsza...Read More","og_url":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/","og_site_name":"Blog o Microsoft Dynamics 365 Business Central","article_published_time":"2019-04-03T20:12:02+00:00","article_modified_time":"2019-04-03T20:12:19+00:00","og_image":[{"width":1918,"height":952,"url":"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1","type":"image\/png"}],"author":"rafal","twitter_card":"summary_large_image","twitter_creator":"@rbabaczyk","twitter_site":"@rbabaczyk","twitter_misc":{"Written by":"rafal","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/","url":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/","name":"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central? - Blog o Microsoft Dynamics 365 Business Central","isPartOf":{"@id":"https:\/\/d365bc.info.pl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage"},"image":{"@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1","datePublished":"2019-04-03T20:12:02+00:00","dateModified":"2019-04-03T20:12:19+00:00","author":{"@id":"https:\/\/d365bc.info.pl\/#\/schema\/person\/f5cb8e045a4a97815cd6e40491adefad"},"breadcrumb":{"@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#primaryimage","url":"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1","contentUrl":"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1","width":1918,"height":952},{"@type":"BreadcrumbList","@id":"https:\/\/d365bc.info.pl\/en\/dlaczego-nie-powinienes-tworzyc-extensions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Strona g\u0142\u00f3wna","item":"https:\/\/d365bc.info.pl\/"},{"@type":"ListItem","position":2,"name":"Dlaczego nie powiniene\u015b tworzy\u0107 Extensions do Business Central?"}]},{"@type":"WebSite","@id":"https:\/\/d365bc.info.pl\/#website","url":"https:\/\/d365bc.info.pl\/","name":"Blog o Microsoft Dynamics 365 Business Central","description":"Polski blog o Microsoft Dynamics 365 Business Central (dawniej Dynamics NAV)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/d365bc.info.pl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/d365bc.info.pl\/#\/schema\/person\/f5cb8e045a4a97815cd6e40491adefad","name":"rafal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/d365bc.info.pl\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/76728b0891ff455b2cb63205ba51106e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/76728b0891ff455b2cb63205ba51106e?s=96&d=mm&r=g","caption":"rafal"}}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/d365bc.info.pl\/wp-content\/uploads\/2019\/04\/title.png?fit=1918%2C952&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3iarJ-of","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/posts\/1503"}],"collection":[{"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/comments?post=1503"}],"version-history":[{"count":16,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/posts\/1503\/revisions"}],"predecessor-version":[{"id":1529,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/posts\/1503\/revisions\/1529"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/media\/1518"}],"wp:attachment":[{"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/media?parent=1503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/categories?post=1503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/d365bc.info.pl\/en\/wp-json\/wp\/v2\/tags?post=1503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}