Adding Days to Date via BPM

Hello, which expression would I use to add the days specified in a field to another date field, and how should I set up the BPM?

For our purposes, I have created a UD field for calibration frequency (days), and would like to add this value to the last calibration date to calculate the next calibration due date.

Thanks!

I would recommend an In-Trans Data Directive.
I would add a condition widget that says when a value changes from any to another referring to the Last Calibration Date. When true, point to a Set Field widget for your Calibration Due Date field. You can just put .AddDays(#) to any DateTime value and it will return a new date based on the # of days you put inside the parenthesis. It would look something like this:

TableName.LastCalibrationDate.AddDays(TableName.Frequency_c)

Obviously, you’ll need to grab the correct table and field names. Let me know if any of that doesn’t make sense. Also, you might need to do some data validation before setting the field (for instance make sure Frequency_c isn’t null. Also, I’m not sure what happens if you feed it a 0. You’d want to test for those types of conditions.

1 Like