In this post, I am sharing how to customize (add or remove) Guardrails warnings.
(1) Adding your custom Guardrail warnings
Create an activity named "CheckForCustomWarnings" in the Rule class where you want to add warnings to. For example, if you want to add warnings to Flow action, create it in Rule-Obj-FlowAction class. Write a Java code as below, and configure When condition.
(2) Remove out-of-the-box Guardrail warnings
It is not recommended to remove the out-of-the-box warnings, as they are intended to check if developer's code is complying with good practices. However, in unusual circumstances you may want to do so. For example, recently I have found a product issue in warning logic - when you do Obj-Browse, if you specify a property (optimized) under a Single Page for filtering, system throws "pzObjBrowse-InvalidProp" SEVERE warning for no reason. This was actually acknowledged as a product defect (INC-159925) and will be fixed in the future release. We can justify it for the time being, but I would rather want to eliminate it as it is still counted as warnings.
In such cases, you can suppress the warnings. Create an activity named "CheckForCustomWarnings" in the Rule class where you want to remove warnings from. For above example, place it in Rule-Obj-Activity class. Then write a Java code as below.
Replace "pzObjBrowse-InvalidProp" with the warning name that you want to get rid of. If you want to suppress multiple warnings, concatenate them by || (OR) operator.
***Edited by Moderator: Pooja Gadige to add platform capability tag, add Developer Knowledge Share tag***