Discussion

How to call OOTB function/utility in javascript

what are the possible ways to call a pega OOTB utility/function in a javasript function

in java it is like rulesetname_libraryname.SomeFunctionName (parameters);

how about in javascript function?

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

February 15, 2011 - 9:54am

embed the code snippet in a java directive (<% java code here %>) in your javascript function eg.

function test (){

<% rulesetname_libraryname.SomeFunctionName (parameters); %>

}

February 15, 2011 - 10:11am

Hi,
Use ajax call in side of your script.

Regards,
Alagar Pandi.

February 17, 2011 - 3:36pm

Create an Activity and access your RUF in the activity. The code to execute an activity through java script.

<script>

var objSafeURL = new safeURL();
objSafeURL.put("pyActivity","className.ActivityName");
var retValue = httpRequestAsynch(objSafeURL.toURL());

</script>

Thanks
Chiranjeevi

February 21, 2011 - 12:15pm

Thanks, It helped.

April 26, 2012 - 2:56am

It is not 'safeUrl' but 'SafeUrl'. That is why it is giving the error undefined. But it this is still not working you may have to import SafeURLInclude fragment which includes safeUrl.js file to the page. But normaly this script we do not need to include because it most likely to be included by some other rule.

Best Regards
-Suresh-

quote:


Originally posted by RISHURAJ

quote:

Originally posted by KUMAR1234

Thanks, It helped.

Hi Kumar,
I tried this technique, but I am getting javascript error saying "safeURL is undefined".Do I need to import some js files explicitly? How can I get information regarding all such kind of js functions? Please help. Thanks in advance.

Thanks and regards


November 26, 2011 - 8:07am

quote:


Originally posted by KUMAR1234

Thanks, It helped.

Hi Kumar,
I tried this technique, but I am getting javascript error saying "safeURL is undefined".Do I need to import some js files explicitly? How can I get information regarding all such kind of js functions? Please help. Thanks in advance.

Thanks and regards