Posts

Showing posts from December, 2023

How to get current index in for each page loop

Image
Hi All, In this blog we will see how we can get loop count value for each iteration. How to get current index in for each page loop?                               You can make use of Param.pyForEachCount to get current iteration index value. This is pega ootb parameter. Lets create an activity to demonstrate this. Add above steps in activity. And now run the activity and open tracer to check value of Param.Index, Param.Count and Param.Cnt which will give loop index or loop iteration number. Now open Property-Set line 190 and open Parameter Page Name We get last loop count value in all Param variables that we define in activity. Now we can use these value in our business logic as per requirement  Thank you!! Will see you all in next blog post 😊.

Obj-Refresh and Lock method In Pega

Image
Hi All, In this blog we will see Locking mechanism basics in pega. And Obj-Refresh-And-Lock. Pega level lock basics When someone opens an assignment, the state becomes "Perform" mode and lock is obtained by the system. The lock information is inserted into "PR_SYS_LOCKS" table in the database and it is managed there. In this period, no other user can open the same assignment. When user submits or cancel the assignment, the state becomes "Review" mode and lock is released. The record is deleted from the table.  For more information visit below link. Pega Lock mechanism Note While acquiring lock a record will be inserted in to data.pr_sys_locks (Class = System-Locks) which contains lock information like who locked and when it will be released. While releasing the lock you can see a delete operation is performed from data.pr_sys_locks table Obj-Refresh-And-Lock Use this method to assure that the contents of the step page are current and a lock is held on the ...

Pega YouTube Video Links

Image
How To Increase Database Table Column Length In PEGA Note:-   First Add PegaRULES:DatabaseAdministrator In your access group roles Configure > System > Database > Schema tools How To Call Decision Table From Data Transform @(Pega-RULES:DecisionTable).ObtainValue(tools,PageName,DecisionTableName) Above function takes 4 parameter.  

Function Alias and its Config in Pega

Image
Hi All, In this blog we will see how to use Function Alias rule to create functions that we can use in Report definition rule. To get custom function in Report we use Function Alias. Note:- After creating Function Alias and doing checkin, we need to logout and relogin again. Note:- To make Function Alias available in reports, create Function Alias rule in Embed-UserFunction class. https://www.youtube.com/watch?v=b35cxmyrrZo Function Alias are part of Technical Category. 1) Function Alias  ( ID = AddDaysToDate ) In Reference Tab INPUT PARAMETERS i) days            Data type = Integer          Type = SmartPrompt ii) startDate        Data type = Date          Type = Autocomplete PRESENTATION Return type = Date Category = Date Pattern template = Add {1} days to {2} date Echo template = Add {1} days to {2} date SOURCE to_date({2},'YYYYMMDD')+{1} After saving rule following cod...

Pega Expression to take Date from DateTime

Image
 Hi All, In this blog we will see some of the most frequently used logic in our project. Here our requirement is to get date from given timestamp in format yyyyMMdd. Param.TimeStamp =  20230721T114545.531 GMT whatComesBeforeLast(whatComesBeforeLast(Param.TimeStamp,'T'),'T') Result =  20230721 Store above result in Param.HD1 = 20220420 @(Pega-RULES:String).substring(Param.HD1,((@(Pega-RULES:String).length(Param.HD1))-8), @(Pega-RULES:String).length(Param.HD1)) Thank you!! Will see you all in next blog post 😊. 

PEGA BLOGS BY ABHISHEK CHOUBEY

Image
Hi All, Followings are links of my Pega blogs  How to get current index in for each page loop Obj-Refresh and Lock method In Pega Function Alias and its Config in Pega Pega Expression to take Date from DateTime PEGA BLOGS BY ABHISHEK CHOUBEY Regular Expression in Pega Pega Frequently Used String Function And Expressions Custom Pega Function - Add three Months to Date Custom Pega Function - Difference between Dates In Month Email Sending Activities In Pega To Search/Filter For All the Node Level Data Pages In Pega Application Setting Button Alignment In Pega py-icons Visual Reference In Pega Display and Validation Section In Property General Tab Passing Query String Parameter To External Link In Pega pyForEachCount In Pega pxSubscript and pxListSubscript Properties In Pega When Rule Expression For Checking Given Case Is Parent Or Not Frequently Used Date Expressions In Pega Pega Happy Learning !! 😊

Java Code to Delete Specific Character from the end of String

Image
 Java Code to Delete Specific Character from the end of String import java.lang.*; import java.io.*; import java.util.*; public class Test { public static String nop(String x,int y) { String ans = x.substring(0,x.length()-y); return ans; } public static void main(String[] args) { System.out.println(nop("IOP12345ABC",2)); } } Output ======= IOP12345A

RegularExpression Pega

Image
 Hi !! In this post we will see some of the regular expressions used in pega 1) To get Digits from Strings pxReplaceAllViaRegex(Param.HistoryDateExp,"[^0-9]","") Param.HistoryDateExp  =  ABC12345 Output = 12345 2) To get Capital Letter from given text pxReplaceAllViaRegex(Param.HistoryDateExp,"[^A-Z]","") Param.HistoryDateExp = ABCdef12345 Output = ABC 3) To get Small letter from given text pxReplaceAllViaRegex(Param.HistoryDateExp,"[^a-z]","") Param.HistoryDateExp = ABCdef12345 Output = def 4) To get Small letters + Capital letters from given text pxReplaceAllViaRegex(Param.HistoryDateExp,"[^A-Za-z]","") Param.HistoryDateExp = ABCdef12345 Output = ABCdef 5) To remove @ from emailid pxReplaceAllViaRegex(Param.HistoryDateExp,"[@]","") Param.HistoryDateExp = abc@gmail.com Output = abcgmail.com 6) To remove @ and . from emailid pxReplaceAllViaRegex(Param.HistoryDateExp,"[@].",...

Pega Frequently Used String Function And Expressions

Image
 Hi, In this blog we will see some of the frequently used expression and functions. 1)  trim(@substring(@whatComesBeforeFirst(Param.HistoryID,'T'),9) Ex: Put Param.HistoryID = CTA-12009 20210315T143845.210 GMT Output =  20210315 2) getCurrentDateStamp()  Return type of getCurrentDateStamp() is String. Get the current date in Pega format (yyyyMMdd) Output = 20231201

Custom Pega Function - Add three Months to Date

Image
 Hi, In this blog we will see now to create our own custom function for adding 3 months to Date. Before Creating our function we need to create Library (Data Instance Rule).   Go to Records --> Technical --> Library  (Right click create) Library Name = ArtLib RuleSet Name = Art In Packages Tab, inside Java packages to Include 1) java.io.*; 2) java.util.*; 3) javax.xml.transform.*; 4) javax.xml.transform.stream.*; 5) java.time.*; 6) java.time.format.*; 7) java.time.temporal.*; {checked} Library ready to compiled? Now, Go to Records --> Technical --> Function --> Right Click Create Function Name = AddthreeMonthsToStringDate-(String) Parameters (TAB) Input parameters StrDate         String  (Java type)   Output Java data type = String Pega type = Text Java (TAB) LocalDate local_date_1; LocalDate  local_date_2; DateTimeFormatter formatter_1 = DateTimeFormatter.ofPattern("yyyyMMdd"); String str_date_1 = StrDate; Local_dat...

Custom Pega Function - Difference between Dates In Month

Image
 Hi, In this blog we will see now to create our own custom function for finding difference between dates, will give difference in the form of number of months. Before Creating our function we need to create Library (Data Instance Rule).  Go to Records --> Technical --> Library  (Right click create) Library Name = ArtLib RuleSet Name = Art In Packages Tab, inside Java packages to Include 1) java.io.*; 2) java.util.*; 3) javax.xml.transform.*; 4) javax.xml.transform.stream.*; 5) java.time.*; 6) java.time.format.*; 7) java.time.temporal.*; {checked} Library ready to compiled? Now, Go to Records --> Technical --> Function --> Right Click Create Function Name = DifferencebetweenDatesInMonth  In Input Parameters StartDate      String (Java Type) EndDate        String (Java Type) In Output Parameters Java data type = int Pega type = Number In Java Tab, write below Java Code, Java Source LocalDate local_date_1; LocalDate loc...