I am having a terrible time with adjusting a date field. I have a series of record storage numbers that require different retention periods, and I want the destruction date to be calculated at the time that expiration date is entered. Expiration date IS a time/date field, but it contains multiple values. I entered the code in both the form and in the view column, but neither worked - it shows as blank, not even an error. Can anyone tell me what I am doing wrong?
Is RecordStorageNumber a “number” field or is it stored as text? If it’s a number field then:
@If(RecordStorageNumber = 2402; …
quotes make it a text value. Also, are you trying to adjust the year ahead by 15 or 2 years? And, if the ExpDate field is multi-value the code will likely adjust all dates in the field, although I’ve not looked into it or tested to see if @Adjust will even work on a MV field, but logically it should.
RecordStorageNumber is a text field, with four different possible values. Each of the four values has a different retention period, so for 2402 I’m trying to add 15 years to ExpirationDate, ExpDate is a time/date,multivalue. If the retention periodis for otherwise, I want to adjust by 2 years, or six years, etc.
I was wondering if I should be using some @Text or @TexttoNumber, but the Record Storage number isn’t really relevant to the formula, except as a reference point to adjust the Exp Date. Thanks for the response, Paul.