<?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 Re: Creating Rule with JavaScritp in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108558#M30501</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please refer&amp;nbsp; this&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/how-call-external-url-from-back-end-js-webscript/td-p/250244" target="_self" rel="nofollow noopener noreferrer"&gt;Thread&lt;/A&gt;&amp;nbsp;, May be helpful to you.&lt;/P&gt;</description>
    <pubDate>Sat, 16 May 2020 03:11:06 GMT</pubDate>
    <dc:creator>sp2</dc:creator>
    <dc:date>2020-05-16T03:11:06Z</dc:date>
    <item>
      <title>Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108553#M30496</link>
      <description>&lt;P&gt;Hi..&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am creating rules for a folder. I want a JavaScript function to be executed when creating a file. Where do I add this JavaScript function?&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2020 14:27:43 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108553#M30496</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-12T14:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108554#M30497</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You need create xxx.js with your function inside Repository-&amp;gt;Data Dictionary-&amp;gt;Scripts folder.&lt;/P&gt;&lt;P&gt;Create rule : Select Folder: Manage rule-&amp;gt;Create New rule with following parameter.&lt;/P&gt;&lt;P&gt;Name : Provide rule name&lt;/P&gt;&lt;P&gt;Define rule : Select relevant option from dropdown.&lt;/P&gt;&lt;P&gt;Perform Action : Select execute script and choose your created xxx.js file.&lt;/P&gt;&lt;P&gt;Other Options: Select relevant option.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 07:08:08 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108554#M30497</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-13T07:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108555#M30498</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/36939"&gt;@sanjaybandhniya&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.. This work very well!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 14:13:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108555#M30498</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-13T14:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108556#M30499</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/36939"&gt;@sanjaybandhniya&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have followed all these steps that you told me. Apparently the script I select doesn't run. Please check.&lt;/P&gt;&lt;P&gt;My file is called GravityForm.js&amp;nbsp;with this content&lt;/P&gt;&lt;P&gt;function traer(){&lt;BR /&gt;var user = "Luis";&lt;BR /&gt;var name ="Diaz";&lt;BR /&gt;alert("Nombre: " + user + " Apellido: " + name);&lt;/P&gt;&lt;P&gt;$.ajax({&lt;BR /&gt;type: "POST",&lt;BR /&gt;url: "http://localhost/alfresco/index.php/wp-json/gf/v2/workflow/webhooks/10/Fytn4QUNj9XWrzcvRzAPG79CB",&lt;BR /&gt;data:{Nombre:user, Apellido:name},&lt;BR /&gt;success: function(data)&lt;BR /&gt;{&lt;BR /&gt;alert ("Muy bien");&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;} // Cierra de la funcion TRAER&lt;BR /&gt;traer();&lt;/P&gt;&lt;P&gt;The rule is created this way&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Alfresco » Reglas de carpeta - Google Chrome 2020-05-13 12.08.28.png" style="width: 971px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/652i2C49AF8A64C8469A/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I add the GravityForm.js file in the /Repository/DataDictionary/Script directory&lt;/P&gt;&lt;P&gt;This does not run. I tested this code in a local installation and it works fine.&amp;nbsp;Also try printing only one value like this console.log ("Test"); and it doesn't work either.&amp;nbsp;I want it to run when a document is created.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 16:15:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108556#M30499</guid>
      <dc:creator>viperboys</dc:creator>
      <dc:date>2020-05-13T16:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108557#M30500</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can not call ajax from rule script as it is server side script.&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 02:57:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108557#M30500</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-16T02:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Rule with JavaScritp</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108558#M30501</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Please refer&amp;nbsp; this&amp;nbsp;&lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/how-call-external-url-from-back-end-js-webscript/td-p/250244" target="_self" rel="nofollow noopener noreferrer"&gt;Thread&lt;/A&gt;&amp;nbsp;, May be helpful to you.&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 03:11:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/creating-rule-with-javascritp/m-p/108558#M30501</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2020-05-16T03:11:06Z</dc:date>
    </item>
  </channel>
</rss>

