How to return Pega pyid to javascript async API call

Share with Love

We need to create a case using javascript API asynchronous call, After creating the case we expect the case ID for further processing. please help us how to do that?.

 

I believe there should be a JS function that do what you need, but at this moment I don’t know, so I did it manually.

Use the Show-Property method in your activity to show the property value that will be caught by the javascript function (you can return any property, like the pyID).

Create the following javascript function (your logic will reside in the success callback)

  function callAc() {
    var oSafeURL = new SafeURL("DMOrg-DM-Work-Demo.MyActivity");
    var postData = new SafeURL();
    postData.put("pzPrimaryPageName", "pyWorkPage");
    pega.u.d.asyncRequest("POST", oSafeURL, {
      success: function(o) {
         console.log(o.responseText);
      }
    }, postData);  
  }

Call this function to retrieve the property value from the activity. See below screenshot

 

 

 

 

By Admin

Sam is the founder and editor of TheGuestBlogging.com. With over 10 years of experience in website development, WordPress, SEO, and digital marketing, he helps businesses, bloggers, and website owners grow their online presence through content marketing and search engine optimization. I regularly writes about blogging, guest posting, technology, entertainment, and online business trends. My goal is to provide accurate, helpful, and up-to-date information that helps readers make informed decisions.

View All Posts