I want to get a status based on the date difference ersult

Hi there,
This is what I am using in scripted fields

def sorDate = new Date().getTime() - doc['sor_idate'].value;
if (sorDate > 5){
return "crtical"
};
The field is defined as below and I have an error and cannot figure out what is wrong, would deeply appreciate the help. Thanks

Hi @alig,

Welcome to the community! I see a warning message in the corner of the image, but no error detail. Can you share the error detail you are seeing?