Question
Ernst & Young LLP
IN
Last activity: 20 Jun 2020 3:44 EDT
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:
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****