I have a field named "OI Date" where user can select the date. Also I have a dropdown field called "Opportunity age group" where the option set will be 0-30 days, 31-60 days and so on.
My requirement is to display the "Opportunity age group" option sets automatically by comparing how old the opportunity is based on "OI Date" and the date when the record is created (Today's date).
For eg:
If the OI date is 13.08.22 and I am entering the record today then the option set should display as 0-30 days by comparing OI date and the date record is created on.
Can anyone help me how to write script for this?