Hi,
I am using client side validation using script component on field event . However my problem is that, record is saved in both cases either validation is true or false . Could you please suggest me how could I prevent record saving when validation on field is false..
Thanks.
Client-side validation support is NOT extensible in Rollbase.
If required, you can write a custom scirpt component and prevent the form from being submitted in case any of the fields has invalid input as per your custom validation rules.
However, the right approach would be to write custom validation rules against field definition on server-side. This way, validation rules will also be enforced when field value is set via API, in addition to UI form pages.
Hi Siraj ,
Thanks a lot for your suggestion. Could you please guide me with small set of code for custom validation rules against field definition on server-side. Let say my field name is "Amount" and I want if amount is > = 2000 then user could not create record and get a message "Amount is less then 2000".
Thanks a lot.
John.
Sure John.
In Field Definition -> Validation. Add the following code snippet:
if({!amt#value} < 2000){
return 'Amount should be atleast 2000';
}
where 'amt' is integration code for a field called Amount.
Thank you Siraj,
Its working...
Regards.
John.
Hi Siraj,
Could you please suggest me why this code is not working .
if(!rbv_api.getFieldValue('CheckValidation', {!id}, 'cvCity').matches("[a-zA-Z]+"))
{
return 'Only Character Allowed';
}
here I am placing server side validation on "City" field that only accept character value. Please let me know if any correction required.
Thanks.
John.
Hi John,
Can you try below code?
var value="{!cvCity#value}";
if(!value.match(/^[a-zA-Z]*$/))
{
return 'Only Character Allowed';
}
Regards,
Shiva
Thanks Shiva,
Now It is working.
Regard.
John.
Hi All,
Could you guys please suggest me how could I create a button on new record creating page.
Thanks,
John.
Hi Shivani,
Thank you so much .
On click of custom button no event occurs ... could you Please suggest How to bind events on custom buttons in rollbase.
Regards.
John.
Hi John,
When you update any field using custom button, you can fire an event of that field.
Events page will be available in object definition
Object Definition > Fields section
Observe that 'Events' link will be there for all types of fields.
Thanks and Regards,
Chandu.