<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Low Code Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/low-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/low-code/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Wed, 08 May 2019 11:38:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Beware of the Lost Variables Default Values</title>
		<link>https://blogit.create.pt/hugoalex/2019/05/08/beware-of-the-lost-default-value/</link>
					<comments>https://blogit.create.pt/hugoalex/2019/05/08/beware-of-the-lost-default-value/#respond</comments>
		
		<dc:creator><![CDATA[Hugo Alexandre]]></dc:creator>
		<pubDate>Wed, 08 May 2019 11:38:31 +0000</pubDate>
				<category><![CDATA[OutSystems]]></category>
		<category><![CDATA[Low Code]]></category>
		<category><![CDATA[OutSystems 10]]></category>
		<category><![CDATA[OutSystems 11]]></category>
		<category><![CDATA[Static Entities]]></category>
		<guid isPermaLink="false">https://blogit.create.pt/?p=9704</guid>

					<description><![CDATA[<p>Hello and welcome to Variables Default Value Issue. This Post is meant to explain a &#8216;Feature&#8217; on the OutSystems 10 and 11 (the ones I tested) platform, where the Default Value of a Variable is lost when moving Entities, or Static Entities from one Module to another. So, although we know that OutSystems Development Platform [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/hugoalex/2019/05/08/beware-of-the-lost-default-value/">Beware of the Lost Variables Default Values</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Hello and welcome to Variables Default Value Issue. <br>This Post is meant to explain a &#8216;Feature&#8217; on the OutSystems 10 and 11 (the ones I tested) platform, where the Default Value of a Variable <strong>is</strong> <strong>lost</strong> when moving Entities, or Static Entities from one Module to another.</p>



<p>So, although we know that OutSystems
Development Platform is &#8216;top gun&#8217; we also know that is developed by humans, and
humans usually make mistakes. </p>



<p>Today I want to show you that you shouldn&#8217;t
trust the default value of your variables, when bounding it to other than <strong>Basic
Data types</strong>.</p>



<p>So the scenario is the follow:</p>



<p>Imagine that you are building a ComboBox and
you bound this Combo&#8217;s Source Entity to a very simple Static Entity </p>



<figure class="wp-block-image"><img fetchpriority="high" decoding="async" width="224" height="301" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS1-1.jpg" alt="" class="wp-image-9715" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS1-1.jpg 224w, https://blogit.create.pt/wp-content/uploads/2019/05/OS1-1-223x300.jpg 223w" sizes="(max-width: 224px) 100vw, 224px" /></figure>



<p>A Person type, and we will assume that there only exists 3 of these, <strong>Adult, Child and Baby.</strong> </p>



<p>And so, all is good in the kingdom of
Outsystems. You Bond the Combo to a variable of the type PersonType Identifier</p>



<figure class="wp-block-image"><img decoding="async" width="410" height="191" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS2-1.jpg" alt="" class="wp-image-9716" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS2-1.jpg 410w, https://blogit.create.pt/wp-content/uploads/2019/05/OS2-1-300x140.jpg 300w" sizes="(max-width: 410px) 100vw, 410px" /></figure>



<p>And change the value of the combo to display
the data based on the type of person you selected on that Combo. </p>



<p>So for instance you would have something like
this (assuming that you have an entity with PersonType Identifier as an
atribute for each PersonType and an Expression below the ComboBox to display
the Name of the Person)</p>



<figure class="wp-block-image"><img decoding="async" width="513" height="169" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS3-1.jpg" alt="" class="wp-image-9717" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS3-1.jpg 513w, https://blogit.create.pt/wp-content/uploads/2019/05/OS3-1-300x99.jpg 300w" sizes="(max-width: 513px) 100vw, 513px" /></figure>



<figure class="wp-block-image"><img decoding="async" width="513" height="180" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS4-1.jpg" alt="" class="wp-image-9718" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS4-1.jpg 513w, https://blogit.create.pt/wp-content/uploads/2019/05/OS4-1-300x105.jpg 300w" sizes="(max-width: 513px) 100vw, 513px" /></figure>



<p>Now you bound that Local Variable&#8217;s <strong>default
value</strong> to be <strong>&#8216;Adult&#8217; type&#8217;,</strong> so that each time you enter the page it
displays the Adults first.</p>



<figure class="wp-block-image"><img decoding="async" width="405" height="192" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS5-1.jpg" alt="" class="wp-image-9719" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS5-1.jpg 405w, https://blogit.create.pt/wp-content/uploads/2019/05/OS5-1-300x142.jpg 300w" sizes="(max-width: 405px) 100vw, 405px" /></figure>



<p>And you are done with your development. All
is working good, months have passed and you got 0 complains about your perfect
and complex WebSite.</p>



<p>But today your Boss decides to call you and
say, &#8216;We have done a great job building that website, but it’s somehow slow. As
so, we will separate the entities and static entities and put them on another
application.&#8217; </p>



<p>Like a good lad you do it, unaware about the
danger that is coming…</p>



<p>So you start by moving the Entities to the
other Application and doing so will, of course, create a ton of errors, because
the module doesn&#8217;t know where are those entities you are referring to.</p>



<figure class="wp-block-image"><img decoding="async" width="939" height="154" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS6-1.jpg" alt="" class="wp-image-9720" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS6-1.jpg 939w, https://blogit.create.pt/wp-content/uploads/2019/05/OS6-1-300x49.jpg 300w, https://blogit.create.pt/wp-content/uploads/2019/05/OS6-1-768x126.jpg 768w, https://blogit.create.pt/wp-content/uploads/2019/05/OS6-1-696x114.jpg 696w" sizes="(max-width: 939px) 100vw, 939px" /></figure>



<p>But once you manage the dependencies and grab
the entities you moved to the new application the errors are automatically
corrected because the amazing OutSystems will know that those are the Entities
you are looking for. And so the green color of joy will appear…</p>



<figure class="wp-block-image"><img decoding="async" width="456" height="87" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS7-1.jpg" alt="" class="wp-image-9721" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS7-1.jpg 456w, https://blogit.create.pt/wp-content/uploads/2019/05/OS7-1-300x57.jpg 300w" sizes="(max-width: 456px) 100vw, 456px" /></figure>



<p>Publishing it will be a terrible mistake, but
you do it anyways.</p>



<p>What happened, you may ask? Here is what, once you moved the entities and you got the errors saying that there isn&#8217;t a known Entity to bound your variables and inputs, you <strong>lost your default value</strong> of your Variable bound to the ComboBox we mentioned in the beginning.</p>



<figure class="wp-block-image"><img decoding="async" width="412" height="188" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS8-1.jpg" alt="" class="wp-image-9722" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS8-1.jpg 412w, https://blogit.create.pt/wp-content/uploads/2019/05/OS8-1-300x137.jpg 300w" sizes="(max-width: 412px) 100vw, 412px" /></figure>



<p>And this &#8216;Bug&#8217; is a master in disguised
because it leaves no errors or warnings.</p>



<p>What will happen is once you access your
webpage you will find that you don’t have any adults to display.</p>



<figure class="wp-block-image"><img decoding="async" width="486" height="151" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS9-1.jpg" alt="" class="wp-image-9723" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS9-1.jpg 486w, https://blogit.create.pt/wp-content/uploads/2019/05/OS9-1-300x93.jpg 300w" sizes="(max-width: 486px) 100vw, 486px" /></figure>



<p>But you do have, Hugo was an Adult like we
have seen. In fact, if you change your combo box to any other value and change
it back to the Adult value you will see Hugo there.</p>



<figure class="wp-block-image"><img decoding="async" width="492" height="126" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS10-1.jpg" alt="" class="wp-image-9724" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS10-1.jpg 492w, https://blogit.create.pt/wp-content/uploads/2019/05/OS10-1-300x77.jpg 300w" sizes="(max-width: 492px) 100vw, 492px" /></figure>



<p>What is happening is, Outsystems will by
default bound the variable to its default value, if there isn&#8217;t one, it will
put the value to null, 0, or something similar. As the variable is bounded to
the combobox, and we didn&#8217;t specify a specialList value it will display the
first record of the static entity &#8216;Person Type'(the one we used to fill the
ComboBox with) which is Adult. </p>



<p>This is a visual error, misleading the user
to believe that there aren&#8217;t any Adults. But it could be a List of records, it
could be a dead end, &#8220;if there aren&#8217;t any adults, disable combobox&#8221;,
it could be something way more important than just displaying the adults that
we have previously created.</p>



<p>So, in order to avoid this issue, you should
always bound your variables, that you want to display straight away in the
first load of the page, on the Preparation of the WebPage.</p>



<figure class="wp-block-image"><img decoding="async" width="741" height="760" src="https://blogit.create.pt////wp-content/uploads/2019/05/OS11.jpg" alt="" class="wp-image-9725" srcset="https://blogit.create.pt/wp-content/uploads/2019/05/OS11.jpg 741w, https://blogit.create.pt/wp-content/uploads/2019/05/OS11-293x300.jpg 293w, https://blogit.create.pt/wp-content/uploads/2019/05/OS11-356x364.jpg 356w, https://blogit.create.pt/wp-content/uploads/2019/05/OS11-696x714.jpg 696w, https://blogit.create.pt/wp-content/uploads/2019/05/OS11-410x420.jpg 410w" sizes="(max-width: 741px) 100vw, 741px" /></figure>



<p>That way you will assure that even if someday
you change the structure, entities, or static entities, the value you want to
be firstly displayed will always be the same. </p>



<p>Oh, and leave the default values of the
variables to <strong>Basic Data types</strong> 🙂</p>
<p>The post <a href="https://blogit.create.pt/hugoalex/2019/05/08/beware-of-the-lost-default-value/">Beware of the Lost Variables Default Values</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/hugoalex/2019/05/08/beware-of-the-lost-default-value/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
