<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Updating from data using c#</title><link>https://www.aras.com/community/f/development/37978/updating-from-data-using-c</link><description>Hi, I need help. I&amp;#39;m doing something that should be easy, but no!!!. 
 
 I want to schedule an event that when the data is saved, save option, make me a count and update the form. I have created the onAfterUpdate event on the ItemType i tried too onBeforeUpdate</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Updating from data using c#</title><link>https://www.aras.com/community/thread/9484?ContentTypeID=1</link><pubDate>Mon, 08 May 2023 07:37:41 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:08c905b9-9a24-4f3c-a9d5-b6bd1b49da80</guid><dc:creator>FernandoCG</dc:creator><description>&lt;p&gt;Thanks for showing me the way. Little by little I&amp;#39;m taking it forward.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating from data using c#</title><link>https://www.aras.com/community/thread/9476?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 13:54:37 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:da6a6172-925c-4ffb-8d63-bd21eacd9d3d</guid><dc:creator>alaxala</dc:creator><description>&lt;p&gt;If you get your vac_* values using AML query you get the old data as you code run before update. Changes are available as relationships of the &amp;quot;this&amp;quot;. But changes only.&lt;/p&gt;
&lt;p&gt;There was a similar question here some time ago. Maybe this help you.&lt;/p&gt;
&lt;p&gt;&lt;a href="/f/development/36948/update-parent-item-when-relationships-tab-is-changed"&gt;Update Parent Item when Relationships Tab is Changed&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating from data using c#</title><link>https://www.aras.com/community/thread/9475?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 12:35:41 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:c0b6c7a1-51e9-4d0a-9d93-e3c7af2de38a</guid><dc:creator>FernandoCG</dc:creator><description>&lt;p&gt;Yes!!, its works!!!!. Thanks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Now the problem is that when executing the method before saving the related table, the one below. Since the changes are not saved, they are not applied to the summation. If I press the save button twice, the second time it already applies the changes. Which is logical since the data is not yet saved.&lt;/p&gt;
&lt;p&gt;Another question, to get the counter of the selected days I execute this AML:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CodigoAML = &amp;quot;&amp;lt;Item type=&amp;#39;MP CONTROL PRESENCIA&amp;#39; action=&amp;#39;get&amp;#39; returnMode=&amp;#39;countOnly&amp;#39;&amp;gt;&amp;lt;mp_con_usr&amp;gt;&amp;quot;+sourceID+&amp;quot;&amp;lt;/mp_con_usr&amp;gt;&amp;lt;mp_tipo_inci&amp;gt;V&amp;lt;/mp_tipo_inci&amp;gt;&amp;lt;/Item&amp;gt;&amp;quot;;
var ResultadoControlP = innovator.applyAML(&amp;quot;&amp;lt;AML&amp;gt;&amp;quot;+CodigoAML+&amp;quot;&amp;lt;/AML&amp;gt;&amp;quot;);

int vac_DiasDisfrutados = ResultadoControlP.getItemCount();
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there a better way to get the data?.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Too many thanks!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Updating from data using c#</title><link>https://www.aras.com/community/thread/9474?ContentTypeID=1</link><pubDate>Thu, 04 May 2023 11:56:11 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b8b0155a-5ab1-4df8-9c6a-667b5118bde5</guid><dc:creator>alaxala</dc:creator><description>&lt;p&gt;You don&amp;#39;t need (and it&amp;#39;s not allowed, so you get error) an additional update in the onBeforeUpdate method. Just change the properties of &amp;quot;this&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;this.setProperty(&amp;quot;mp_dias_vac_restantes&amp;quot;, vacDiasRestantes);
this.setProperty(&amp;quot;mp_dias_vac_apuntadas&amp;quot;, vac_DiasApuntados);
this.setProperty(&amp;quot;mp_dias_vac_disfrutadas&amp;quot;, vac_DiasDisfrutados);
return this;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And more likely you need link you method to onBeforeAdd too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>