- Can I use profiles to validate my data input when I'm using RIDC?
There are a couple of prerequisite steps to follow:
- In the Content Server general configuration, enable the following setting:
- In the RIDC code, do not use CHECKIN_UNIVERSAL as the service call, but use CHECKIN_NEW instead. (CHECKIN_UNIVERSAL doesn't load the profile engine.)
Now build the rule solution. The following bare-bones example makes the "Comments" field "required" to be a non-blank value for a new checkin.
- In Configuration Manager. create a new global profile rule. Set the activation conditions to "on submit" and "checkin new".
- Add the "Comments" field to the rule. In the "Use Derived Value" section, add the following code in the custom section:
<$abortToErrorPage("Cannot submit item without any comments provided.")$>
- Save the rule and exit Configuration Manager.
- To test the solution, execute your RIDC code without providing any comments. If you didn't provide any comments, the error message thrown is "Cannot submit item without any comments provided."