Discussion
How to call Pega CPM function from an Ajax call
Hi All,
I am using Pega v 7.1.7 and I have a requirement to call an activity based on incoming call through AJAX (which is working) and through this acivity I need to invoke PEGA OOTB CPM function.
As per the design We can add CPM js files in harness and call the function from function but I need to call OOTB function from an activity.
Pls guide/suggest if anybody has done the similar implementation ?
many thank
***Edited by Maryrita: Moderator, added group tags***
sharad
Hi Sharad, what is the CPM function that you are trying to call ? Since the JS functions are executed on the client side and the activities run on the server side, calling a JS function from an activity is not possible. Could you not call the CPM JS function from the same place that you call the AJAX from ? Wait for the response from the AJAX call and make sure it was successful and then call the CPM function.