<?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>AML search with parameter</title><link>https://www.aras.com/community/f/applications/4003/aml-search-with-parameter</link><description>Is there any way to add the current date , as dynamic parameter into the AML search?

I want to do something like this:

&amp;lt;aer_date condition=&amp;quot;le&amp;quot;&amp;gt;@today&amp;lt;/aer_date&amp;gt;
&amp;lt;aer_date_end condition=&amp;quot;ge&amp;quot;&amp;gt;@today&amp;lt;/aer_date_end&amp;gt;</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: AML search with parameter</title><link>https://www.aras.com/community/thread/2227?ContentTypeID=1</link><pubDate>Tue, 30 Oct 2018 10:28:00 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:3ca06357-90a6-445b-b204-95ac83052986</guid><dc:creator>Meismart</dc:creator><description>Another approach would be to write an onBeforeGet for the ItemType and convert a known value to today&amp;#39;s date as above.

edit: by picking a date such as &amp;quot;1/1/1900&amp;quot; your users could then use simple search and you could create them a saved search with this value.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: AML search with parameter</title><link>https://www.aras.com/community/thread/2226?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2018 10:56:51 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:9cb5d995-d690-4c87-bf7d-fd9ba2dad37a</guid><dc:creator>Christopher Gillis</dc:creator><description>Hello,

This kind of dynamic parameter isn&amp;#39;t yet supported in the standard AML Search, but you could write a custom Server Method that does this kind of replacement. You could then call that Server Method by passing the name into the action of your AML query like &lt;code&gt;&amp;lt;Item type=&amp;quot;Part&amp;quot; action=&amp;quot;My Custom Get&amp;quot;/&amp;gt;&lt;/code&gt;.

The example code below is a rough demonstration of what this method could look like.

&lt;pre&gt;&lt;code&gt;// Change the action to a real get
this.setAction(&amp;quot;get&amp;quot;);
// Get today&amp;#039;s date in the appropriate format
string todaysDate = DateTime.Now.ToString(&amp;quot;yyyy-MM-dd&amp;quot;);
// Perform a raw string replacement of the @today variable and today&amp;#039;s date
string updatedAml = &amp;quot;&amp;lt;AML&amp;gt;&amp;quot; + this.dom.OuterXml.Replace(&amp;quot;@today&amp;quot;, todaysDate) + &amp;quot;&amp;lt;/AML&amp;gt;&amp;quot;;
return this.getInnovator().applyAML(updatedAml);&lt;/code&gt;&lt;/pre&gt;


If you&amp;#39;d like to run a search on the current date and time you can instead use a format like: &lt;code&gt;yyyy-MM-ddTHH:mm:ss&lt;/code&gt;

Chris

&lt;hr /&gt;

Christopher Gillis

Aras Labs Software Engineer&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>