Question

2
Replies
50
Views
ShwetaB2746 Member since 2020 13 posts
Ernst & Young LLP
Posted: 3 months ago
Last activity: 3 months 1 week ago

Activity is not getting called from a HTML

Hi All,

Have written an HTML rule and on the click of the below button trying to call an activity. 

<div class="divbutton"> <button class="button button2" name="Accept" type="button" onclick="validate()">ACCEPT</button> </div>

The following code snippets have been tried :

Code 1:

<script type="text/javascript">     function validate(){              var suURL = SafeURL_createFromURL(pega.u.d.url);          suURL.put("pyActivity", "UpdateAvailedPrivacyNotice");          suURL.put("pyClassName", "Data-Portal");             warningFlagEnabled= httpRequestAsynch(suURL.toURL(),"", 50, 100);       alert("Activity executed");     }   </script>

 

Code 2: 

<script type="text/javascript">     function validate(){             var xmlhttp;       if(window.XMLHttpRequest){         xmlhttp=new XMLHttpRequest();       }else{         xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");       }              var strWorkURL = new SafeURL();       strWorkURL.put("pyActivity","Data-Portal.UpdateAvailedPrivacyNotice")       xmlhttp.open("GET",strWorkURL.toURL(),false);       xmlhttp.send(null);       alert("Activity executed");    location.reload(true);     }   </script>

 

Have also done the below changes in Activity as attached.

 

 

***Edited by Moderator Marissa to update Platform Capability tags****

Pega Platform 8.3.1 User Interface
Share this page LinkedIn