Close popover
Biswajit Mitra (BISWAJIT-2)
Tata Consultancy Services

Tata Consultancy Services
BISWAJIT-2 Member since 2010 22 posts
Tata Consultancy Services
Posted: June 3, 2016
Last activity: April 6, 2017

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:

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");

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();

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