<?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/"><channel><title>yanjim さんの グループ アクティビティ</title><link>https://www.aras.com/community/members/yanjim</link><description>yanjim さんの グループ ユーザーの最近のアクティビティ</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>Server method - onAfterCopy and set current user as requester</title><link>https://www.aras.com/community/f/development/35992/server-method---onaftercopy-and-set-current-user-as-requester</link><pubDate>Tue, 22 Sep 2020 13:54:19 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:d08fd52d-86ad-4f4b-858b-d8ef152f3787</guid><dc:creator>yanjim</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;My code looks like as following and it does not work, the method name is DLV_changes_after_copy:&lt;/p&gt;
&lt;p&gt;Innovator inn = this.getInnovator();&lt;br /&gt;string strPPSRequester = this.getProperty(&amp;quot;requester&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;Item fromUser = inn.getItemById(&amp;quot;User&amp;quot;, inn.getUserID());&lt;br /&gt;// Get to identity&lt;br /&gt;string idnt_id = fromUser.getProperty(&amp;quot;owned_by_id&amp;quot;);&lt;br /&gt;Item requester = inn.getItemById(&amp;quot;Identity&amp;quot;,idnt_id);&lt;br /&gt;requester=requester.apply();&lt;br /&gt;this.setPropertyItem(&amp;quot;requester&amp;quot;,requester);&lt;br /&gt;return this;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have created a server method - onAfterCopy named&amp;nbsp;&lt;span&gt;DLV_changes_after_copy, simply to change the requester property with current user name instead of old requester after copy.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The Item DLV_PPS property looks as follow:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/3/pastedimage1600782818659v1.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Any idea, why&amp;nbsp;it doesn&amp;#39;t&amp;nbsp;work?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BR,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Jimmi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Send email to task assignee by field event</title><link>https://www.aras.com/community/f/development/34948/send-email-to-task-assignee-by-field-event</link><pubDate>Wed, 03 Jun 2020 11:05:08 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a1d8fc99-afa3-4842-a812-4fe3713ff71f</guid><dc:creator>yanjim</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;We have a customized task request application in Aras and I want to build a method to send assignee an email when the task has been assigned to the person.&lt;/p&gt;
&lt;p&gt;I want to add the method to a field event, onChange. So, when the assignee changes value, an email will be sent. See attached screenshots.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/3/Action_5F00_request1.jpg" /&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/3/Action_5F00_request2.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;And my code:&lt;/p&gt;
&lt;p&gt;Innovator inn = this.getInnovator();&lt;br /&gt;string str_body = &amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;// Get assignee&lt;br /&gt;string assignee = this.getProperty(&amp;quot;dlv_assignedto&amp;quot;,&amp;quot;&amp;quot;);&lt;/p&gt;
&lt;p&gt;//Get Url&lt;br /&gt;string str_actionID = this.getProperty(&amp;quot;id&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;string str_actionReq = &amp;quot;DLV_ActionReq&amp;quot;;&lt;br /&gt;string link = string.Format(@&amp;quot;&amp;lt;html&amp;gt;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;&amp;quot;{2}/Default.aspx?StartItem={0}:{1}&amp;quot;&amp;quot;&amp;gt;Click here to open the ticket&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/html&amp;gt;&amp;quot;,str_actionReq, str_actionID, CCO.Request.Url.ToString().Substring(0,CCO.Request.Url.ToString().IndexOf(&amp;quot;/Server/&amp;quot;)));&lt;br /&gt; &lt;br /&gt;// Get Mail &lt;br /&gt;Item email = inn.newItem(&amp;quot;Email Message&amp;quot;, &amp;quot;get&amp;quot;);&lt;br /&gt;email.setID(&amp;quot;11A395B11B3A4337AE24F539266E815D&amp;quot;);&lt;br /&gt;email = email.apply();&lt;/p&gt;
&lt;p&gt;email.setProperty(&amp;quot;subject&amp;quot;, string.Format(&amp;quot;The following Action Request {0} has been assigned to you&amp;quot;,this.getProperty(&amp;quot;item_number&amp;quot;,&amp;quot;&amp;quot;)));&lt;br /&gt;str_body = string.Format(@&amp;quot;&amp;lt;html&amp;gt;&amp;lt;B&amp;gt;The following Action Request {0} has been assigned to you. &amp;lt;br&amp;gt;{1} &amp;lt;br&amp;gt;Best regards,&amp;lt;br&amp;gt;Engineering Capability Office&amp;quot;,this.getProperty(&amp;quot;item_number&amp;quot;,&amp;quot;&amp;quot;), link);&lt;/p&gt;
&lt;p&gt;email.setProperty(&amp;quot;body_html&amp;quot;, str_body);&lt;/p&gt;
&lt;p&gt;// Get Identity for assignee&lt;br /&gt;if ( assignee != &amp;quot;&amp;quot; ) {&lt;br /&gt; string str_reqby = this.getPropertyAttribute(&amp;quot;dlv_assignedto&amp;quot;, &amp;quot;keyed_name&amp;quot;);&lt;br /&gt; Item iden = this.newItem(&amp;quot;Identity&amp;quot;, &amp;quot;get&amp;quot;);&lt;br /&gt; iden.setProperty(&amp;quot;name&amp;quot;, str_reqby);&lt;br /&gt; iden = iden.apply(); &lt;br /&gt; if ( iden.getItemCount() == 1) { Boolean result = this.email(email, iden); }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;return this;&lt;/p&gt;
&lt;p&gt;---------------------------------------------------&lt;/p&gt;
&lt;p&gt;Any idea why it does not work?&lt;/p&gt;
&lt;p&gt;Have tried with server events, onAfterUpdate and it works. But not working with onAfterUnlock, it will solve my problem as well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Jimmi&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Field event &amp;quot;onChange&amp;quot; triggers method twice, bug?</title><link>https://www.aras.com/community/f/community/35720/field-event-onchange-triggers-method-twice-bug</link><pubDate>Fri, 26 Jun 2020 08:38:21 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:a864d733-2624-4fe5-ba32-f5facd8b67e7</guid><dc:creator>yanjim</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have created a field event onChange, see picture below:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/10/pastedimage1593160398255v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;It worked well with following&amp;nbsp;exceptions:&lt;/p&gt;
&lt;p&gt;1. The confirm dialog appears twice each time&amp;nbsp;&lt;span&gt;dlv_assigned_to field is changed, does it need a delay somehow?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. When the&amp;nbsp;dlv_assigned_to&amp;nbsp;changes by&amp;nbsp;search dialog (... button), the confirm dialog will not appear. Bug?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The method code looks as following:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;var dlvAssignedTo = document.thisItem.getProperty(&amp;#39;dlv_assignedto&amp;#39;);&lt;/p&gt;
&lt;p&gt;if (dlvAssignedTo)&lt;br /&gt;{&lt;/p&gt;
&lt;p&gt;if (!top.aras.confirm(&amp;#39;Do you want to send mail to DLV Assigned to User?&amp;#39;))&lt;br /&gt;{&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;var callServerMethod = aras.IomInnovator.newItem(&amp;#39;Method&amp;#39;, &amp;#39;DLV_ActionReq_Assignment&amp;#39;);&lt;br /&gt;callServerMethod.setProperty(&amp;#39;dlv_assignedto&amp;#39;, dlvAssignedTo);&lt;br /&gt;callServerMethod.setProperty(&amp;#39;item_number&amp;#39;, document.thisItem.getProperty(&amp;#39;item_number&amp;#39;));&lt;br /&gt;var result = callServerMethod.apply();&lt;br /&gt;if (result.isError())&lt;br /&gt;{&lt;br /&gt;aras.AlertError(result.getErrorString());&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;aras.AlertSuccess(&amp;#39;Email sent successfully.&amp;#39;);&lt;br /&gt;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Related post:&lt;/p&gt;
&lt;p&gt;&lt;a href="/f/development/34948/send-email-to-task-assignee-by-field-event"&gt;https://community.aras.com/f/development/34948/send-email-to-task-assignee-by-field-event&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Ask A Question I</title><link>https://www.aras.com/community/achievements/460ac7df-7ccc-4c42-a204-9e05eef3be09</link><pubDate>Wed, 03 Jun 2020 02:26:48 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:232ca842-9790-45d1-a442-995758a0ce08</guid><dc:creator /><description>Ask a question in a forum.</description></item></channel></rss>