Morning,
I'm setting up a Behaviour with an initalizer that I want to check if a specific custom field has a value or not (null). In the instance where there is value already present in the custom field then I don't want the initalizer to run.
// Retrieve the value of the customfield
def outcome = getFieldByName('Board Summary Outcome for Applicant').getValue()
if(outcome != null ) {return}
// It's null so let's add some default text
getFieldByName('Board Summary Outcome for Applicant').setFormValue("Dummy Text Here.")
The code above looks reasonable however what I'm finding is it works perfectly when there is no value in the custom field (tick) but if the field has an entry (i.e. text) then that text is updated with the "Dummy Text Here" which is not the behaviour that I want.
Any help would be much appreciated, for whatever reason the outcome variable always resolves to null