RunTime Error on PropertyValueInvalid (Invalid number format pegaToBigDecimal)
Is there OOTB function that I can use to determine Invalid number format ? I have a web form where a user is entering an invalid data type (for example :- user enters alphabet characters instead of numeric characters).
PEGA throws an 'is not a valid decimal value'
but I also get a run time error because I am doing a PostValue and running a DT of the posted value.
On the onChange event of this property I have a PostValue and a refresh of this section with a data transform that uses this entered property. As the invalid property is posted, the data transform that fires is picking up the wrong data type posted value and I am getting a run time error.
I see the following exceptions in the Tracer .pegaToBigDecimal() Invalid number format
Is there any Pega function that I can use on the Change event to determine if a VALID datatype is entered BEFORE I execute the Post value? I was not able to find pegaToBigDecimal() or Invalidnumberformat() or any OOTB functions.
I would like to check for a valid value before I do the PostValue and/or run the DataTransform? Any input from you would be appreciated.
***Edited by Moderator: Lochan to update platform capability tags***
Based on your requirement you want to trigger a Data Transform onchange of the value of the property but it should only be triggered if the data entered in the field is correct. If my understanding is correct you can try the below approach:
Create a Declare onChange rule, and configure an activity to run. So this activity will run automatically when the property value changes.
In the activity you can have a step to call Data Transform (using Apply Data Transform method) and have a when rule configured on this step which will make sure that this step is skipped if there is message on the page(using hasmessage).
Does the DeclareONchange fire even before the Change Activity as shown in my screenshot?
My assumption is that the Declare Expressions run in the background and there is no way to call them in sequence. Are you saying all Declare rules (like Expression , Trigger etc.) fire first i.e. even before an 'event' change like shown in my screenshot ?
Also when I write an activity to find out if my page has messages on it, PEGA is complaining
'The use of activity rules should be limited. The need for activities can be reduced by using data transforms, as well as techniques such as case management, the Engine API, and declaratives.'
Ideally I want to run a Data Transform only. My problem would be solved if I can validate the entered value before I 'Post Value'. So I am asking if there is a OOTB VALIDATE function that exists to check if the required format of data was entered or keyed in. The Tracer seems to be using 'pegaToBigDecimal' but I am unable to find it and also PEGA seems to be calling an in built function that validates the datatype entered which is throwing the error 'Invalid number format'
Do you know what the in built function in PEGA is and whether a developer can use it, that will throw 'invalid number format' error?
I am not sure even if I trace it multiple times, I will know whether DECLARE RULES fire before or after user events like Change, Focus, PostValue etc. the reason being DECLARE RULES are PEGA Rules that are supposed to run in the 'background'. Is my understanding correct?
So if at a point in time if my Declare Rules run and my tracer verifies that they are executed before an 'OnChange' event, I cannot assume that will be the case always because at another point in time, my Declare Rules may run after an 'OnChange' event as they are supposed to run in the background.
Need an authority on PEGA to confirm or deny that DECLARE RULES ALWAYS fire BEFORE a User initiated Event like shown below.
i.e If I use Change event (of a property) to run a Data Transform, will the Declare Rule run first or the Data Transform rule run first.
Another option that you can use is with "Change" event in the cell property run activity and mention the activity which is calling the Data Transform based on the when condition explained in previous comments.
In this way you can define the order which you want i.e. If you want the activity with when condition and Data Transform to be called first and then the other Data Transform, then configure in that order.