<?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>C# -  applySQL. &amp;quot;Select sum()......&amp;quot;</title><link>https://www.aras.com/community/f/development/38252/c---applysql-select-sum</link><description>Hello colleagues, I have a problem. I&amp;#39;m trying to do a SQL, select sum(.....). The code doesn&amp;#39;t give me an error, but I don&amp;#39;t know how to access the value of the variable later. 
 If you see my code, I have assigned a name to the value received, but when</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: C# -  applySQL. "Select sum()......"</title><link>https://www.aras.com/community/thread/10136?ContentTypeID=1</link><pubDate>Wed, 21 Feb 2024 10:29:25 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b85a28bb-1525-41b5-9f7d-00c2a27eb157</guid><dc:creator>FernandoCG</dc:creator><description>&lt;p&gt;ha ha ha. Never surrender!!!. Only I already suffer it in silence!! hehehe. What I&amp;#39;ve been doing lately, I more or less control it!! Although I have some &amp;quot;polstergeists&amp;quot; that I can&amp;#39;t figure out why.&lt;/p&gt;
&lt;p&gt;But yes, sometimes it makes me want to run away!! :).&lt;/p&gt;
&lt;p&gt;The problem was that although I had written in the SQL to return the value as &amp;quot;Result&amp;quot;, in the getProperty it had to say &amp;quot;result&amp;quot;, all in lowercase, I don&amp;#39;t know why. In SQL Server, it returns the field name as I define it: &amp;quot;Result&amp;quot;.&lt;/p&gt;
&lt;p&gt;Thanks for the link!!, I searched with a magnifying glass, but I didn&amp;#39;t find anything. or broken links.&lt;/p&gt;
&lt;p&gt;I have some questions, I&amp;#39;ll post them in the forum...... :)&lt;/p&gt;
&lt;p&gt;I have in hand to modify the &amp;quot;PE_GetMultilBom&amp;quot; method. I made a first attempt, but it doesn&amp;#39;t show me the value on the screen. I&amp;#39;ll put a post in the forum asking for help, hehe.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="/community/resized-image/__size/640x480/__key/communityserver-discussions-components-files/3/pastedimage1708511361510v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much!!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C# -  applySQL. "Select sum()......"</title><link>https://www.aras.com/community/thread/10112?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2024 09:17:35 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:34d886a0-f135-45bd-8efd-99952efbc43b</guid><dc:creator>AngelaIp</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;glad to see you haven&amp;acute;t given up yet! :)&lt;/p&gt;
&lt;p&gt;Normally SQL is executed form server Method. Does your version really work from a client Method?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One issue that I notice are these two lines:&lt;/p&gt;
&lt;p&gt;ResultadoSQL = innovator.applySQL(SentenciaSql);&lt;/p&gt;
&lt;p&gt;// tomamos el valor de la suma&lt;br /&gt;var LT_Par = ResultadoSQL.getProperty(&amp;quot;Resultado&amp;quot;,&amp;quot;0&amp;quot;);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You execute the SQL, but than immediately want to read a column of the result. But you haven&amp;acute;t got the result item itself yet. applySQL can return multiple items!&lt;/p&gt;
&lt;p&gt;Try something like this&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Item sqlItem =&amp;nbsp;&lt;span&gt;ResultadoSQL.getItemByIndex(0).getProperty(&amp;quot;Resultado&amp;quot;,&amp;quot;0&amp;quot;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To my knowledge there is no inbuilt option to make &amp;quot;SUM&amp;quot;. You can replicate &amp;quot;Count&amp;quot;, but for other stuff you would need a custom Method, like described here:&amp;nbsp;&amp;nbsp;&lt;a href="https://www.aras.com/community/f/development/3653/how-to-implement-groupby-and-max-in-aml"&gt;How to Implement &amp;quot;GroupBy&amp;quot; and &amp;quot;Max()&amp;quot; in AML?&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But for your use case (updating multiple very specific relationships), using SQL is ok.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: C# -  applySQL. "Select sum()......"</title><link>https://www.aras.com/community/thread/10103?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2024 10:18:29 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:b515411b-1461-4537-90b7-e38b556f5722</guid><dc:creator>FernandoCG</dc:creator><description>&lt;p&gt;Ok, I have passed the code to Javascript and used the debugger.&lt;/p&gt;
&lt;p&gt;The problem is that I called it &amp;quot;Resultado&amp;quot;, but when I execute the SQL it returns as &amp;quot;resultado&amp;quot;.&lt;/p&gt;
&lt;p&gt;If someone can answer questions 1 and 2 for me, I would be grateful!!&lt;/p&gt;
&lt;p&gt;1.- There is something similar in AML to &amp;quot;select sum&amp;quot;&lt;/p&gt;
&lt;p&gt;2.- How can I pass the value of &amp;quot;SQLResult&amp;quot; to a variable to be able to display it on the screen.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>