I am using behavior to set up an error on a rich text custom field if it is not updated. When I try to compare using ==, it is not working. I have a default table added on a rich text field. I want to show error message if the field is not changed/updated.
I have below server side script:
def customRichTextField = getFieldById(fieldChanged)
def customRichTextFieldValue = customRichTextField.value.toString()
def customRichTextFieldDefaultValue = "||header1||header2||header3||header4||header5|| | | | | | |"
if(customRichTextFieldDefaultValue == customRichTextFieldValue){
customRichTextField.setError("Please update custom rich text field")
}else{
customRichTextField.clearError()
}
When I tried to print the default value on console, it gives me the exact same value that I am using as default string. When I try to alert customRichTextFieldValue, it shows the exact value as default value when it is not changed. But still comparison is not working.