Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Question

I have a quote Quote with the expiry date already in the past and when I create a copy of the quoteQuote, the date changes to "today". The effective date is not copied from the original quote Quote and in the copy it is also set to "today". So I end up with a quote Quote which has both effective and expiry dates set to "today" which is not ideal.

Is it possible to have the header logic to set the dates like this: expiry = today + x days?

...

hiddentrue

...

Answer

You can try this:

Code Block
languagegroovy
if (earliestEffectiveDate == null) earliestEffectiveDate = today
if (latestExpiryDate == null) latestExpiryDate = today + 90
 
quoteProcessor.updateField("targetDate", earliestEffectiveDate)
quoteProcessor.updateField("expiryDate", latestExpiryDate)