Пример #1
0
        protected virtual void EPActivity_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
        {
            var row = e.Row as EPActivity;

            if (row == null)
            {
                return;
            }

            var activity = DefaultEmailProcessor.GetParentOriginalActivity(this, (int)row.TaskID);

            if (activity != null)
            {
                GotoParentActivity.SetVisible(true);

                PXUIFieldAttribute.SetReadOnly <EPActivity.entityDescription>(cache, e.Row);
                var isMessageFailed = row.MPStatus == MailStatusListAttribute.Failed;
                row.EntityDescription = isMessageFailed ? CacheUtility.GetErrorDescription(row.Exception) : string.Empty;
                var helper = new EntityHelper(this);
                var entity = activity.RefNoteID.With(refNoteId => helper.GetEntityRow(refNoteId.Value));
                if (entity != null)
                {
                    row.EntityDescription += CacheUtility.GetDescription(helper, entity, entity.GetType());
                }
            }
            else
            {
                GotoParentActivity.SetVisible(false);
            }
        }
Пример #2
0
        protected IEnumerable gotoParentActivity(PXAdapter adapter)
        {
            var parentOriginalActivity = Activites.Current.With(act => DefaultEmailProcessor.GetParentOriginalActivity(this, (int)act.TaskID));

            if (parentOriginalActivity != null)
            {
                new EntityHelper(this).NavigateToRow((long)parentOriginalActivity.NoteID, PXRedirectHelper.WindowMode.New);
            }
            return(adapter.Get());
        }