Function Alias and its Config in Pega
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 code get generated in Generated Output TAB.
2) Custom Function Alias
Pattern template = Sign Off Status {1} Who Signed Off {2}
Echo template = Direct / Indirect Sign Offf
SOURCE
CASE WHEN {1} = 'Signed Off'
THEN
CASE WHEN ({2} LIKE '%Customer%' OR {2} LIKE '%Partner%')
THEN
'Direct Sign Off'
ELSE
'Indirect Sign Off'
END
ELSE
NULL
END
Now, lets start using these functions in report definition rule.
Click function expression button in columns section of report definition rule.
Thank you!! Will see you all in next blog post 😊.
Comments
Post a Comment