{"id":373,"date":"2019-03-25T17:30:32","date_gmt":"2019-03-25T20:30:32","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/working-with-formulas-at-elipse-e3\/"},"modified":"2019-07-05T16:41:45","modified_gmt":"2019-07-05T19:41:45","slug":"working-with-formulas-at-elipse-e3","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/","title":{"rendered":"Working with Formulas at Elipse E3."},"content":{"rendered":"<div align=\"justify\">\n<p><u><b>1) Introduction<\/b><\/u><\/p>\n<p><b>Formulas <\/b>are modules designed to store and transfer value sets to certain variable groups, in order to create pre-defined settings. E3&#8217;s Formulas module provides you will all the tools needed to create these value sets (Formulas) and link them to a Template. <b>Templates <\/b>are the formatted tables in a Database, and they inform the number of variables comprising a formula, the data type that can be stored in each variable, and the types of permissions and restrictions. Formulas that were created for a certain Template can be sent to\/loaded into either a Template or a variable group, as long as the 1:1 ratio of the elements in the template is obeyed.<\/p>\n<p>The variable groups are also called <b>Units<\/b>, and different units can be assigned to the same template. Thus, when you send the formula values to a set of tags, the Formula will be the origin of the data and the Units will be the data destination. But when you save the current tag values in a formula, the tags are the data origin and the Formula is the destination. The Template will only define the amount of data in these operations, as well as their type and restrictions.<\/p>\n<p>To use this resource, right-click the project and select the item <b>Formula<\/b>.<\/p>\n<p><b>Using Formulas in Elipse E3: Examples<\/b><\/p>\n<p>Formulas can be used in some application cases. For example:<\/p>\n<ul>\n<li>When the client needs to store values and then load them into tags at a specific time.<\/li>\n<li>When the client needs retentive tags, i.e., tags that maintain the last applied values when the domain is closed.<\/li>\n<\/ul>\n<p>To show you how to use Formulas in E3, we will create a project that reproduces the first application example. This project simulates loading values that will be used for manufacturing candy by three machines. Initially, there will be five types of candy.<\/p>\n<p><u><b>2) Creating the project<\/b><\/u><\/p>\n<p>First, create a default project called <b>TrainingFormulas <\/b>inside <span style=\"font-family: Courier New;\">C:\\TrainingFormulas<\/span>, and select the <b>Save data on disk<\/b> option. The database should be called <b>Formulas.mdb<\/b>. Then, rename the screen to <b>Formulas<\/b>, and select the Viewer to open this screen.<\/p>\n<p><b>Creating data and the formula<\/b><\/p>\n<p>In the data server, create the three following folders: <b>Machine1<\/b>, <b>Machine2<\/b>, and <b>Machine3<\/b>. Inside each of these folders, create four internal tags: <b>Sugar<\/b>, <b>Water<\/b>, <b>Glucose<\/b>, and <b>Syrup<\/b>.<\/p>\n<p>Then, insert a formula in your project with a table called <b>Candy<\/b>, and select the <b>DBServer <\/b>database. All the data from this formula, such as format and values, will be stored in this table.<\/p>\n<p>On the desktop, insert four new templates called <b>Sugar<\/b>, <b>Water<\/b>, <b>Glucose<\/b>, and <b>Syrup<\/b>. To demonstrate how to use restrictions, the first two items will be set with absolute limits, and the forth one will be set with a restricted limit. These values will be set as seen in figure 1. Each restriction is explained in its respective setup window, which can be accessed through the ellipsis button located on the right side of the edit restriction area. These restrictions prevent invalid values from being input to the tags, as they may cause problems in the process, such as wastage, defective products, etc.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure1.png\" alt=\"\" width=\"500\" height=\"208\" align=\"baseline\" border=\"0\" \/><br \/>\n<span style=\"font-size: xx-small;\"><b>Figure 1:<\/b> Creating restrictions<\/span><\/div>\n<p>Having done that, select Units tab and create three items: <b>Machine1<\/b>, <b>Machine2<\/b>, and <b>Machine3<\/b>. Then, refer each item to their respective tags, as seen in figure 2. These links will also be saved in the database table along with the formula data.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure2.png\" alt=\"\" width=\"500\" height=\"94\" align=\"baseline\" border=\"0\" \/><br \/>\n<span style=\"font-size: xx-small;\"><b>Figure 2:<\/b> Linking tags<\/span><\/div>\n<p>To finish setting up the formula, create five value sets and set them up as shown in figure 3. These are the initial products and values that we will use. They can be changed later.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure3.png\" alt=\"\" width=\"416\" height=\"117\" align=\"baseline\" border=\"0\" \/><br \/>\n<span style=\"font-size: xx-small;\"><b>Figure 3:<\/b> Setting up values<\/span><\/div>\n<p><b>Setting up the screen to manipulate the formula<\/b><\/p>\n<p>To manipulate the formula, create a screen as shown in the figure 4.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure4.png\" alt=\"\" width=\"319\" height=\"262\" align=\"baseline\" border=\"0\" \/><br \/>\n<span style=\"font-size: xx-small;\"><b>Figure 4:<\/b> Formula manipulation screen<\/span><\/div>\n<p>All texts on the screen are Labels. Next to each &#8220;Candy&#8221; text, a Display should be placed to show which candy is selected. White rectangles are SetPoints for manipulating tags values. Ideally, objects will be created in one of the machines and then copied to the other two, changing only the machine name.<\/p>\n<p>After creating the screen, create an internal tag inside each data server folder (<b>Machine1<\/b>, <b>Machine2<\/b>, and <b>Machine3<\/b>) called <b>CurrentCandy<\/b>. Refer each Display next to the &#8220;Candy&#8221; texts to its respective tag. Refer the SetPoints to their respective tags. Remember that all tags are in data folders referring to the machines.<\/p>\n<p>In order to load the items to the ComboBox, a Query item should be inserted onto screen and set up to produce the <b>Candy_Values<\/b> table, selecting only its <b>Name <\/b>field. Then, set up the following script in the ComboBox&#8217;s <i>OnStartRunning <\/i>event:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Sub ComboBox1_OnStartRunning()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Set RS = Screen.Item(&#8220;Query1&#8221;).GetADORecordset()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0For aux = 1 To RS.RecordCount<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 AddItem CStr(RS.Fields(&#8220;Name&#8221;))<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 RS.MoveNext<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Next<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Sub<\/span><\/div>\n<p>After this, we need to create a procedure to load the values of the selected item in the ComboBox into the tags. To do so, we should create a new event in the ComboBox that will be called whenever the index is changed, i.e., when the selected item is changed.<\/p>\n<p>To create a new event, select the <b>Other Events<\/b> option in the ComboBox script area. To add a new event, just click the addition (+) button. The event should be created as shown in the figure below.<\/p>\n<div align=\"center\"><img loading=\"lazy\" title=\"\" src=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure5.png\" alt=\"\" width=\"383\" height=\"289\" align=\"baseline\" border=\"0\" \/><br \/>\n<span style=\"font-size: xx-small;\"><b>Figure 5:<\/b> Creating the event<\/span><\/div>\n<p>In the event created in the ComboBox, add the following script:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Sub ComboBox1_ListIndexChange()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If Value <> &#8220;&#8221; Then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Set RS = Screen.Item(&#8220;Query1&#8221;).GetADORecordset()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 For aux = 1 To RS.RecordCount<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 If Value = RS.Fields.Item(&#8220;Name&#8221;) then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Formula1&#8221;)_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0 .LoadFormulaValuesQuiet &#8220;Machine1&#8221;, Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value = Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0 Exit Sub<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 RS.MoveNext<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Next<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Sub<\/span><\/div>\n<p>When this script is done, the ComboBox is finished. Then make scripts for the other two ComboBoxes following this pattern. Now we need to setup the buttons for handling the values and the candy.<\/p>\n<p>For the<b> Create New<\/b> button, the script should scan the Database&#8217;s RecordSets to ensure that the name of the candy to be created doesn&#8217;t already exist through an auxiliary variable named <b>equal<\/b>. If it does, it won&#8217;t allow the same name to be created again. If it does not exist, the name will be added normally. To do so, follow the script below:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Sub CommandButton1_Click()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0equal = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Set RS = Screen.Item(&#8220;Query1&#8221;).GetADORecordset()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0For aux = 1 To RS.RecordCount<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 If Screen.Item(&#8220;ComboBox1&#8221;).Value = RS.Fields(&#8220;Name&#8221;) Then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 equal = 1<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 RS.MoveNext<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Next<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If equal = 0 And Screen.Item(&#8220;ComboBox1&#8221;).Value <> &#8220;&#8221; Then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Formula1&#8221;).CreateValue &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Set RS = Screen.Item(&#8220;Query1&#8221;).GetADORecordset()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 RS.MoveLast<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Screen.Item(&#8220;ComboBox1&#8221;).AddItem RS.Fields(&#8220;Name&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Screen.Item(&#8220;ComboBox2&#8221;).AddItem RS.Fields(&#8220;Name&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Screen.Item(&#8220;ComboBox3&#8221;).AddItem RS.Fields(&#8220;Name&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Data.Machine1.Sugar&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Data.Machine1.Glucose&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Data.Machine1.Syrup&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Data.Machine1.Water&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Application.Deactivate()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Application.Activate()<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Sub<\/span><\/div>\n<p>The script works as a template for creating scripts for the two remaining buttons. To create a new type of candy, type its name in the ComboBox and click <b>Create New<\/b> button. Then, set up the values for the candy ingredients. This can be done via the following script in <b>Save <\/b>button, as shown below.<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Sub CommandButton8_Click()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If Application.GetObject(&#8220;Data.Machine1.Water&#8221;).Value >= 5 and &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Machine1.Water&#8221;).Value <= 15 then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Formula1&#8221;).SetValueData &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value, &#8220;Water&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.Water&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Else<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 MsgBox(&#8220;The value you&#8217;ve typed for water is invalid, _<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0because there are restrictions for this item!\u00a0 &#8220;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If Application.GetObject(&#8220;Data.Machine1.Sugar&#8221;).Value >= 5 and &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.Sugar&#8221;).Value <= 20 then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Formula1&#8221;).SetValueData &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value, &#8220;Sugar&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.Sugar&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Else<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 MsgBox(&#8220;The value you&#8217;ve typed for sugar is invalid, _<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 because there are restrictions for this item!&#8221;)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Application.GetObject(&#8220;Formula1&#8221;).SetValueData &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value, &#8220;Glucose&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Machine1.Glucose&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0Application.GetObject(&#8220;Formula1&#8221;).SetValueData &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value, &#8220;Syrup&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Maquina1.Syrup&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If Screen.Item(&#8220;ComboBox2&#8221;).Value = &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0_&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Formula1&#8221;).LoadFormulaValuesQuiet &#8220;Machine2&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Screen.Item(&#8220;ComboBox2&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0If Screen.Item(&#8220;ComboBox3&#8221;).Value = &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Application.GetObject(&#8220;Data.Machine1.CurrentCandy&#8221;).Value then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 Application.GetObject(&#8220;Formula1&#8221;).LoadFormulaValuesQuiet &#8220;Machine3&#8221;, &#038;_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0 _&#038;Screen.Item(&#8220;ComboBox3&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0End If<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Sub<\/span><\/div>\n<p>This script also ensures that the values adjusted to the items are within the selected limit range, and shows an error message when they are not.<\/p>\n<p>Now it is time to create and change values for the types of candy. We will still need to set the application up to allow excluding the selected candy. For this, we will set up a script for the <b>Delete Selection<\/b> button. This script will require protections and a few other procedures so as not have the candy accidentally deleted from all the selected locations. This script will look like this:<\/p>\n<div align=\"left\"><span style=\"font-family: Courier New;\">Sub CommandButton9_Click()<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 index = Screen.Item(&#8220;ComboBox1&#8221;).ListIndex<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Application.GetObject(&#8220;Formula1&#8221;)_<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0 .DeleteValue Screen.Item(&#8220;ComboBox1&#8221;).Value<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 if Screen.Item(&#8220;ComboBox2&#8221;).Value = Screen.Item(&#8220;ComboBox1&#8221;).Value then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox2&#8221;).Enabled = false<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox2&#8221;).Value = &#8220;&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox2&#8221;).Enabled = true<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine2.Sugar&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine2.Glucose&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine2.Syrup&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine2.Water&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 end if<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 if Screen.Item(&#8220;ComboBox3&#8221;).Value = Screen.Item(&#8220;ComboBox1&#8221;).Value then<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox3&#8221;).Enabled = false<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox3&#8221;).Value = &#8220;&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Screen.Item(&#8220;ComboBox3&#8221;).Enabled = true<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine3.Sugar&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine3.Glucose&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine3.Syrup&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0\u00a0\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine3.Water&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 end if<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox1&#8221;).RemoveItem(index)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox1&#8221;).Enabled = false<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox1&#8221;).Value = &#8220;&#8221;<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox1&#8221;).Enabled = true<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine1.Sugar&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine1.Glucose&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine1.Syrup&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Application.GetObject(&#8220;Data.Machine1.Water&#8221;).Value = 0<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox2&#8221;).RemoveItem(index)<\/span><br \/>\n<span style=\"font-family: Courier New;\">\u00a0\u00a0 Screen.Item(&#8220;ComboBox3&#8221;).RemoveItem(index)<\/span><br \/>\n<span style=\"font-family: Courier New;\">End Sub<\/span><\/div>\n<p>Notice that the script scans and deletes the selected item from the database table, and then sets all these values as 0 to then remove the selected item from all ComboBoxes. This script works as a template for the two remaining removing buttons.<\/p>\n<p>Now we can execute the domain and perform the running tests for all resources in the application.<\/p>\n<p><u><b>3) Final Remarks<\/b><\/u><\/p>\n<p>This application was not meant to show the best way to configure the application, but rather a way of using formulas with the highest possible number of features without having to use the pre-set tools in the formulas module. We also tried to show how to update the data in the formula by using another very useful E3 tool &#8211; the E3Query &#8211; which is used to search for data in the database tables.<\/p>\n<p>For any questions or problems related to formulas or specifically to this application, please refer to Elipse Software&#8217;s technical support.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1) Introduction Formulas are modules designed to store and transfer value sets to certain variable groups, in order to create pre-defined settings. E3&#8217;s Formulas module provides you will all the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[745],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Working with Formulas at Elipse E3. - Elipse Knowledgebase<\/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:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with Formulas at Elipse E3.\" \/>\n<meta property=\"og:description\" content=\"1) Introduction Formulas are modules designed to store and transfer value sets to certain variable groups, in order to create pre-defined settings. E3&#8217;s Formulas module provides you will all the&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:30:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-07-05T19:41:45+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure1.png\" \/>\n<meta name=\"author\" content=\"Elipse Software\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elipse Software\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\"},\"author\":{\"name\":\"Elipse Software\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\"},\"headline\":\"Working with Formulas at Elipse E3.\",\"datePublished\":\"2019-03-25T20:30:32+00:00\",\"dateModified\":\"2019-07-05T19:41:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\"},\"wordCount\":1864,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Formulas\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\",\"url\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\",\"name\":\"[:pt]Working with Formulas at Elipse E3.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:30:32+00:00\",\"dateModified\":\"2019-07-05T19:41:45+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Working with Formulas at Elipse E3.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\",\"name\":\"Elipse Software\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"caption\":\"Elipse Software\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Working with Formulas at Elipse E3. - Elipse Knowledgebase","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:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Working with Formulas at Elipse E3.[:] - Elipse Knowledgebase","og_description":"1) Introduction Formulas are modules designed to store and transfer value sets to certain variable groups, in order to create pre-defined settings. E3&#8217;s Formulas module provides you will all the&hellip;","og_url":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:30:32+00:00","article_modified_time":"2019-07-05T19:41:45+00:00","og_image":[{"url":"http:\/\/kb.elipse.com.br\/pt-br\/images\/ID112\/Figure1.png"}],"author":"Elipse Software","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Elipse Software","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/"},"author":{"name":"Elipse Software","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87"},"headline":"Working with Formulas at Elipse E3.","datePublished":"2019-03-25T20:30:32+00:00","dateModified":"2019-07-05T19:41:45+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/"},"wordCount":1864,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Formulas"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/","url":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/","name":"[:pt]Working with Formulas at Elipse E3.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:30:32+00:00","dateModified":"2019-07-05T19:41:45+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/en\/working-with-formulas-at-elipse-e3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Working with Formulas at Elipse E3."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87","name":"Elipse Software","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","caption":"Elipse Software"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/373"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=373"}],"version-history":[{"count":1,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":7628,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/373\/revisions\/7628"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}