Discussion

6
Replies
14218
Views
Biswajit Mitra (BISWAJIT-2)
Tata Consultancy Services

Tata Consultancy Services
GB
BISWAJIT-2 Member since 2010 23 posts
Tata Consultancy Services
Posted: June 3, 2016
Last activity: April 6, 2017
Posted: 3 Jun 2016 9:00 EDT
Last activity: 6 Apr 2017 8:01 EDT
Closed

Calling activity from HTML in section

Hi, I am trying to call an activity and pass parameter to it from java script in a Section. I am not been able to do this. I'm using below code:

<script>
var varNameOnCard = "Biswajit";
oSafeURL =null;
var oSafeURL = new SafeURL("Grp-Data-Fin-PaymentAccount-Card.PostAuthSemafoneTest",getReqURI());
oSafeURL.put("NameOnCard", varNameOnCard )
//var strReturn = httpRequestAsynch(oSafeURL.toURL(),null, 50, 100);
//pega.util.Connect.asyncRequest('GET', oSafeURL.toURL(),'');
var strResponse = httpRequestAsynch(oSafeUrl.toURL(),"post");
</script>

However if I use the below JSP, activity is invoked correctly but I can't pass the parameter on to it from java script code. So if any body can please help understand why the former is not working. Many thanks for help.

<%
String strNameOnCard = "Biswajit";
ParameterPage newParams = null;
HashStringMap keys= null;

newParams = tools.getParameterPage();
newParams.putString("NameOnCard",strNameOnCard);

keys = new HashStringMap();
keys.putString("pxObjClass", "Rule-Obj-Activity");
keys.putString("pyClassName", "Grp-Data-Fin-PaymentAccount-Card");
keys.putString("pyActivityName", "PostAuthSemafoneTest");
tools.doActivity(keys, tools.getPrimaryPage(), newParams);
%>

***Updated by moderator: Lochan to add Categories***

Data Integration Java and Activities User Experience
Moderation Team has archived post, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Discussion, please write a new Discussion.