{"id":39890,"date":"2022-03-31T09:00:48","date_gmt":"2022-03-31T08:00:48","guid":{"rendered":"https:\/\/arquiconsult.com\/?p=39890"},"modified":"2024-10-23T10:54:05","modified_gmt":"2024-10-23T09:54:05","slug":"unicode-characters-as-bitmaps","status":"publish","type":"post","link":"https:\/\/arquiconsult.com\/en\/unicode-characters-as-bitmaps\/","title":{"rendered":"#018 UNICODE CHARACTERS AS BITMAPS"},"content":{"rendered":"<div class=\"services_vertical horizontal_services row\" style=\"background-color: #f7f7f7; padding: 25px; border-radius: 5px; text-align: justify;\">\n<p>Whenever we wanted to show a picture either on a CardPart or a ListPart, we used a Blob type field. Now that Blob with SubType Bitmap has become obsolete in Business Central, we have a new type of field for its replacement \u2013 the Media type.<br \/>\nMedia field works perfectly in a CardPart page, but has some known issues, as for example to appear correctly in a List page. That leaves us with a problem, especially if our clients need for some reason to have an image, logo, or any other type of image in a List.<\/p>\n<p>There is a solution that might help if you face this issue: use <strong>Unicode Characters<\/strong>. We can use symbols such as \u201c\u00a3\u221e\u058d\u06de?\u263c?\u201d and although they are text you might find a replacement for your image.<\/p>\n<p>In the following example we will show a simple solution for their usage.<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Let\u2019s imagine that our client wants to see the stock availability of an item in a faster and simpler way. He asks us to show on the Item page a red, green, or yellow sign if the stock is negative, positive or zero. With the Media type issue, we couldn\u2019t help him, but with the <strong>Unicode Characters<\/strong> we can go around it, inclusive with a more performant solution.<\/p>\n<p>First, we have created an extension of the Item table adding a new text field that will receive our <strong>Unicode Characters.<br \/>\n<\/strong><br \/>\n<img loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/03\/receive-our-Unicode-Characters.png\" alt=\"codigo1\" width=\"628\" height=\"373\" title=\"-\"><\/p>\n<p>Then we have created an Enum that has the colors that we want.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/03\/Then-we-have-created-an-Enum-that-has-the-colors-that-we-want..png\" alt=\"codigo2\" width=\"624\" height=\"511\" title=\"-\"><\/p>\n<p>After this we created a function that returns the <strong>Unicode Characters<\/strong> as text.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/03\/After-this-we-created-a-function-that-returns-the-Unicode-Characters-as-text..png\" alt=\"codigo3\" width=\"619\" height=\"361\" title=\"-\"><\/p>\n<p>To finish we did a comparison to turn our positive, negative or zero stock into the colors that we wanted to show.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/03\/To-finish-we-did-a-comparison-to-turn-our-positive-negative-or-zero-stock-into-the-colors-that-we-wanted-to-show..png\" alt=\"codigo4\" width=\"680\" height=\"220\" title=\"-\"><\/p>\n<p>As a result, we get our Item page showing the signal colors depending on the stock inventory.<\/p>\n<p><img loading=\"lazy\" class=\"aligncenter\" src=\"https:\/\/arquiconsult.com\/wp-content\/uploads\/2022\/03\/As-a-result-we-get-our-Item-page-showing-the-signal-colors-depending-on-the-stock-inventory.-1.jpg\" alt=\"codigo5\" width=\"681\" height=\"325\" title=\"-\"><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-39890\" data-postid=\"39890\" class=\"themify_builder_content themify_builder_content-39890 themify_builder tf_clear\">\n    \t<!-- module_row -->\n\t<div  data-lazy=\"1\" class=\"module_row themify_builder_row tb_nus1581 tb_first tf_clearfix\">\n\t    \t\t<div class=\"row_inner col_align_top col-count-1 tf_box tf_w tf_rel\">\n\t\t\t<div  data-lazy=\"1\" class=\"module_column tb-column col-full first tb_cai8581 tf_box\">\n\t\t\t    \t        <div class=\"tb-column-inner tf_box tf_w\">\n\t\t    <!-- module text -->\n<div  class=\"module module-text tb_9tkr581 arquitps-data  \" data-lazy=\"1\">\n        <div  class=\"tb_text_wrap\">\n    <p><script>\njQuery(\".tbp_post_month:contains(Janeiro)\").html(\"January\");\n\njQuery(\".tbp_post_month:contains(Fevereiro)\").html(\"February\");\n\n\njQuery(\".tbp_post_month:contains(Mar\u00e7o)\").html(\"March\");\n\n\njQuery(\".tbp_post_month:contains(Abril)\").html(\"April\");\n\n\njQuery(\".tbp_post_month:contains(Maio)\").html(\"May\");\n\n\njQuery(\".tbp_post_month:contains(Junho)\").html(\"June\");\n\n\njQuery(\".tbp_post_month:contains(Julho)\").html(\"July\");\n\njQuery(\".tbp_post_month:contains(Agosto)\").html(\"August\");\n\njQuery(\".tbp_post_month:contains(Setembro)\").html(\"September\");\n\njQuery(\".tbp_post_month:contains(Outubro)\").html(\"October\");\n\njQuery(\".tbp_post_month:contains(Novembro)\").html(\"November\");\n\njQuery(\".tbp_post_month:contains(Dezembro)\").html(\"December\");\t\n\n\n\n<\/script><\/p>    <\/div>\n<\/div>\n<!-- \/module text -->\t        <\/div>\n\t    \t<\/div>\n\t\t    <\/div>\n\t    <!-- \/row_inner -->\n\t<\/div>\n\t<!-- \/module_row -->\n\t\t<!-- module_row -->\n\t<div  data-anchor=\"sucesso\" data-hide-anchor=\"1\" data-lazy=\"1\" class=\"module_row themify_builder_row sucesso repeat tb_has_section tb_section-sucesso tb_ma0b8 tf_clearfix\" >\n\t    \t\t<div class=\"row_inner col_align_top col-count-1 tf_box tf_w tf_rel\">\n\t\t\t<div  data-lazy=\"1\" class=\"module_column tb-column col-full first tb_8q8k9 tf_box\">\n\t\t\t    \t        <div class=\"tb-column-inner tf_box tf_w\">\n\t\t    <!-- module buttons -->\n<div  class=\"module module-buttons tb_eusv9 buttons-horizontal transparent popmake-24705 large circle tf_textc\" data-lazy=\"1\">\n    \t<div class=\"module-buttons-item tf_inline_b\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"ui builder_button tb_default_color\" >\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"tf_inline_b tf_vmiddle\">Give as a Feedback and Suggest Questions<\/span>\n\t\t\t\t\t\t\t\t\t\t\t<\/a>\n\t\t\t    \t<\/div>\n\t<\/div>\n<!-- \/module buttons -->\n\t        <\/div>\n\t    \t<\/div>\n\t\t    <\/div>\n\t    <!-- \/row_inner -->\n\t<\/div>\n\t<!-- \/module_row -->\n\t<\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Whenever we wanted to show a picture either on a CardPart or a ListPart, we used a Blob type field. Now that Blob with SubType Bitmap has become obsolete in Business Central, we have a new type of field for its replacement \u2013 the Media type. Media field works perfectly in a CardPart page, but [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":39935,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2099,2124,2132],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts\/39890"}],"collection":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/comments?post=39890"}],"version-history":[{"count":0,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/posts\/39890\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/media\/39935"}],"wp:attachment":[{"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/media?parent=39890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/categories?post=39890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arquiconsult.com\/en\/wp-json\/wp\/v2\/tags?post=39890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}