Hi I am trying to put simple validation in Unmanaged RAP. Below is my validation method looks like

I am seeing message in yellow color... what this message means?
After some reading got to know we need to add determine action and added that method (commented in above screen shot).
Still Validation is not triggered...
In unmanaged scenario validation needs to be done in check_before_save method. So is that means Validations can not be used in Unmanaged scenario ?
I have already used Validation in Managed scenario and it works fine...
Any direction to documentation regarding this issue will help...
Thanks-
Abhishek
Request clarification before answering.
Hi Abhishek,
check if the draft determine action is already exposed in Projection Behaviour ?
// if you use validation in custom determine action - The way you commented in your code
use action trigger_all ;
Or // if you use the validation in standard prepare action.
// --Base behaviour
draft determine action prepare
{
validation validate_age ;
}
// -- Projection behaviour
use action prepare ;Ramjee Korada
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi diegovaldivia
Thanks much for your response...
I understood this and I tried this as well but I don't know how to call this "Prepare" method (in your example)
Do I need to implement determination as well ? How this validation will get Triggered ?
This validation will not Trigger until there is a Draft entry in system or Validation will only be Triggered when opening Draft entry to make any changes ?
Thanks-
Abhishek
Hi Abhishek,
The Prepare method will be called automatically by the RAP framework as soon as you press the Save button.
The RAP Framework usually calls those Draft actions implicitly, that is, we developers don't need to implement any code to handle such Actions, but in cases where we need to do "something" when certain action occurs, then we need to add some code to given actions. In the code in my screenshot, I'm telling the framework to execute given validation when the user presses the Save button.
You don't need to implement the Determination in my screenshot, I'm using it for other stuff not related to your question.
Please refer to following documentation for further information:
I would suggest to implement the Validation method, then set a breakpoint inside it and save a Draft document. You will be able to see the moment it's called.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.