Monday, 27 June 2022

Get PageList Exported to excel

 Get PageList Exported to excel


1. Create a Excel template as following format

    A1: Column Name : Case ID 
    A2: Property Reference as  : {ExcelPage.pxResults().CaseID}   // inside {}

2. upload it as a Binary file in excel format
         “excel” as the App name 
           File type extention as xlsx

3. Call pxGenerateExcelFile and keep primary page as the PageList which need to be exported
            define a file name "Exported.xlsx"
            define the template name as "excel!<FILENAME>!xlsx"

4. add the action set in the button as "open URL in Window" and define the activity name 

Monday, 6 June 2022

Set Property value from Java Script

pega.u.d.setProperty("PageName.Property","Value");


<html>

<body>

function SetPropertyValue(){

var v1 = document.GetElementByID("PropertyName").Value;

pega.u.d.setProperty("PageName.PropertyName","v1");

<input id = "PropertyName" onchange="SetPropertyValue()"/>

<input id = "PropertyName" value= "Value1"/>

</body>

</html>


Sunday, 29 May 2022

Daily Digest

 Remove Selected pages from PageList :

  1. loop through the page list (PageList name --> PGList),
  2. go to the page which need to be deleted and set pyDeletedObject == True,
  3. call the function --> @Utilities.RemoveDeletedObjects(PGList). (outside the pageList context)

Remove Duplicate from PageList:

  1. page list need to be referenced to Code-Pega-List (PGList.pxResults) ,duplicated property is ".Key" 
  2. call @pzRemoveDuplicatesFromListPage(PGList,".Key")

Get subscript from Current page in the pageList

param.pyForEachCount



Set Column type to nvarchar

ALTER TABLE {<DB>.<TableName>} ALTER COLUMN {<Column Name>} nvarchar(256) NULL;

Tuesday, 11 November 2014

Add new Work Object from Activity Rule.

Prerequisites:

Pega 7
New case type added from case types on developer portal on pega 7(Class for new Work item will get created)
Start flow is automatically created (pyStartCase by default)

1.    create activity rule and define work page In ‘page and classes’ tab ;



2.       call createWorkPage OOTB activity on pyWorkPage as the primary page and define the following parameters;(it will create the work page for new work object)



If you want to set values for new work object you can set it to new work page (pyWorkPage) using Property-Set method before continue to next step.


3.        call AddWork OOTB activity on pyWorkPage as the primary page and pass the current parameter page;(it will create new work object and open it)




Friday, 25 October 2013

Java Script referance ~Updating~


1. Run activity from Java script.
var oSafeURL = new SafeURL(" << Class >> . << Acitivity Name >>");
httpRequestAsynch(oSafeURL.toURL());

1)How to write onclick functionality

<script>

function myFunction()
{
alert("Hello World!");
}
</script>
<button onclick="myFunction()">Try it</button>

2) how to call the activity from java script and pass the parameters / catch return values



oSafeURL =null;

var oSafeUrl = new SafeURL("Class.Activity",getReqURI());
oSafeUrl.put("Paramater Name","Paramater Value");
var strResponse = httpRequestAsynch(oSafeUrl.toURL(),"post");
.***any return value from activity. It can be caught in strResponse.***

2. Get property value from Java script.
tools.getProperty("<< pyWorkPage.DOB >>").
tools.findPage("<< Page name >>").getProperty("<< .PropertyName >>").toString()




Sunday, 20 October 2013

How to post updates to Facebook from PRPC

Facebook side implementation ;
1.       Create Facebook App to interact with the PRPC
a.       Go to facebook developer and create an App
b.      Note down app Secret and App ID for future reference

2.       Obtain authorization code from Facebook.

NOTE:
Sometimes some web browsers are giving an errors so try with difference browsers (for me CROME and IE)

a.        Assemble following URL to get authorization code.
Use your APP ID to replace <APPID> on URL given below.

b.      You will redirect to a page where you can allow your application to access your FB account info; click Allow button to give permission to the APP;

c.       Browser will display Success message with  URL contains CODE param in it.
(Eg: http://www.facebook.com/connect/login_success.html?code=
7YaBbdlAXbh2ybD03pwLde4mNaTuu…………
)

d.      Copy “code=….. “  Parameter and it will use as the authorization code.


3.       Obtain Access token from Facebook.
a.       Assemble following URL to get authorization code.
Use your APP ID, App secret, Authorization Code to replace <APPID>,<Appsecret>,<authorization code> on URL given below.

https://graph.facebook.com/oauth/access_token?client_id= <APPID>
&redirect_uri=http://www.facebook.com/connect/login_success.html&
client_secret=<Appsecret>&code=
<authorization code>

b.      This URL will return FB access token on your browser;
Remove “&expires=XXXX” parameter from the end of the token when you use access token.

PRPC side implementation;

1.       Create 4 properties to hold the access token,callback,FB messege and FB ID as below;
       for FB ID use your own FB ID to get posted on your wall.


2.       Create Connect-HTTP rule to connect with FB server;
a.       Set  HTTP Method = GET, HTTP Version =1.1, Response Timeout=30000


b.      Defineà callback, message, target_id ,access_token as parameters on the HTTP rule;

3.       Use previously created activity to call the HTTP-Rule to post FB messege ;

Run and you will see the messege on your facebook wall .


Tuesday, 30 July 2013

Add Custom Task to CMF Calendar

1.       Create  “******Data-TestCalTask”  class and create data table “CalendarTasks “;


2.       Create list view to retrieve  data from the table ;




3.       Save as the pyCMEvents ;




4.       Insert necessary parameter for the calendar to get the information by list view;
 


5.       Custom events , populating from the table;


Get PageList Exported to excel

  Get PageList Exported to excel 1. Create a Excel template as following format      A1: Column Name : Case ID       A2: Property Reference ...