protected virtual void PMTask_StartDate_FieldUpdating(PXCache sender, PXFieldUpdatingEventArgs e)
        {
            if (e.Row == null)
            {
                return;
            }

            PMTask      pmTaskRow    = (PMTask)e.Row;
            PMTaskSSExt pmTaskExtRow = PXCache <PMTask> .GetExtension <PMTaskSSExt>(pmTaskRow);

            if (pmTaskExtRow.Duration != null &&
                pmTaskExtRow.Duration >= 1 &&
                e.NewValue != null)
            {
                SmartsheetHelper smartSheetHelperObject = new SmartsheetHelper();
                DateTime         endDateRow             = smartSheetHelperObject.CalculateWorkingDays((DateTime)e.NewValue, (int)pmTaskExtRow.Duration);
                pmTaskRow.EndDate = endDateRow;
            }
        }
        protected virtual IEnumerable PopulateDates(PXAdapter adapter)
        {
            PMSetup      setupRecord    = this.Base.Setup.Select();
            PMSetupSSExt setupRecordExt = PXCache <PMSetup> .GetExtension <PMSetupSSExt>(setupRecord);

            if (!String.IsNullOrEmpty(setupRecordExt.UsrTypeTaskDate) && setupRecordExt.UsrDurationTaskDate != null)
            {
                foreach (PMTask filter in this.Base.Tasks.Select())
                {
                    PMTaskSSExt pMTaskRecordExt = PXCache <PMTask> .GetExtension <PMTaskSSExt>(filter);

                    if (String.IsNullOrEmpty(filter.StartDate.ToString()))
                    {
                        filter.StartDate = DateTime.Today;
                    }
                    if (String.IsNullOrEmpty(filter.EndDate.ToString()))
                    {
                        switch (setupRecordExt.UsrTypeTaskDate)
                        {
                        case SmartsheetConstants.SSConstants.DAY:
                            SmartsheetHelper smartSheetHelperObject = new SmartsheetHelper();
                            filter.EndDate = smartSheetHelperObject.CalculateWorkingDays((DateTime)filter.StartDate, (int)setupRecordExt.UsrDurationTaskDate);
                            break;

                        case SmartsheetConstants.SSConstants.MONTH:
                            filter.EndDate = ((DateTime)filter.StartDate).AddMonths((int)setupRecordExt.UsrDurationTaskDate);
                            break;

                        case SmartsheetConstants.SSConstants.YEAR:
                            filter.EndDate = ((DateTime)filter.StartDate).AddYears((int)setupRecordExt.UsrDurationTaskDate);
                            break;
                        }
                    }
                    this.Base.Tasks.Cache.Update(filter);
                }
            }
            else
            {
                throw new PXException(SmartsheetConstants.Messages.DURATION_FIELDS_NOT_INDICATED);
            }

            return(adapter.Get());
        }