<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Explanation of or Examples demonstrating interaction between updateParameters and updateMessages in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/explanation-of-or-examples-demonstrating/m-p/1992#M183</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a python Toolbox that has the user select&amp;nbsp;a geodatabase, and uses a hard-coded list of&amp;nbsp;tables and associated field names to set the Value List filters for&amp;nbsp;four&amp;nbsp;additional parameters&amp;nbsp;using the unique values in each of the specified fields. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in the updateParameters code, I am checking for the presence of each table and associated field, and if they exist, setting the parameter's filter list to&amp;nbsp;the unique values. &amp;nbsp;If not, I am clearing the filter list (set to []), and disabling the parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the&amp;nbsp;geodatabase does not contain the table/tables or field/fields needed to create the Value List filters, I would like to provide a custom error message to let the user know that the geodatabase is missing some of the necessary&amp;nbsp;tables/fields. &amp;nbsp; &amp;nbsp;However, it appears I cannot use setErrorMessage in updateParameters because it does not show up in the user interface. &amp;nbsp; &amp;nbsp;And, in this case, because there will be internal errors (some missing values, because the parameter has been disabled), it looks like updateErrors does not get called. &amp;nbsp; I'm not sure about this last statement, because I am a bit unclear about how these class methods interact with what ArcGIS is doing behind the scenes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have combed the ESRI docs for custom toolboxes, as well as other materials that I could find, but am still have challenges with the code due to not quite knowing how these things flow. &amp;nbsp; &amp;nbsp;Most of the code examples I've found are quite simple and/or do not use these methods, so I'm interested in finding other examples that might help clarify this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a related question, I am&amp;nbsp;having some&amp;nbsp;challenges with use of the "altered" versus "hasBeenValidated" parameter. &amp;nbsp; Some additional examples of comparing usage of these parameters would be helpful. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Jul 2017 20:01:15 GMT</pubDate>
    <dc:creator>AllisonBailey</dc:creator>
    <dc:date>2017-07-27T20:01:15Z</dc:date>
    <item>
      <title>Explanation of or Examples demonstrating interaction between updateParameters and updateMessages</title>
      <link>https://community.esri.com/t5/python-questions/explanation-of-or-examples-demonstrating/m-p/1992#M183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a python Toolbox that has the user select&amp;nbsp;a geodatabase, and uses a hard-coded list of&amp;nbsp;tables and associated field names to set the Value List filters for&amp;nbsp;four&amp;nbsp;additional parameters&amp;nbsp;using the unique values in each of the specified fields. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, in the updateParameters code, I am checking for the presence of each table and associated field, and if they exist, setting the parameter's filter list to&amp;nbsp;the unique values. &amp;nbsp;If not, I am clearing the filter list (set to []), and disabling the parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the&amp;nbsp;geodatabase does not contain the table/tables or field/fields needed to create the Value List filters, I would like to provide a custom error message to let the user know that the geodatabase is missing some of the necessary&amp;nbsp;tables/fields. &amp;nbsp; &amp;nbsp;However, it appears I cannot use setErrorMessage in updateParameters because it does not show up in the user interface. &amp;nbsp; &amp;nbsp;And, in this case, because there will be internal errors (some missing values, because the parameter has been disabled), it looks like updateErrors does not get called. &amp;nbsp; I'm not sure about this last statement, because I am a bit unclear about how these class methods interact with what ArcGIS is doing behind the scenes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have combed the ESRI docs for custom toolboxes, as well as other materials that I could find, but am still have challenges with the code due to not quite knowing how these things flow. &amp;nbsp; &amp;nbsp;Most of the code examples I've found are quite simple and/or do not use these methods, so I'm interested in finding other examples that might help clarify this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a related question, I am&amp;nbsp;having some&amp;nbsp;challenges with use of the "altered" versus "hasBeenValidated" parameter. &amp;nbsp; Some additional examples of comparing usage of these parameters would be helpful. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Jul 2017 20:01:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/explanation-of-or-examples-demonstrating/m-p/1992#M183</guid>
      <dc:creator>AllisonBailey</dc:creator>
      <dc:date>2017-07-27T20:01:15Z</dc:date>
    </item>
  </channel>
</rss>

