Beispiel #1
0
                static ListPMTaskAttribute()
                {
                    var values = new List <string>()
                    {
                        " "
                    };
                    var labels = new List <string>()
                    {
                        " "
                    };

                    var          type = typeof(PMTask);
                    ProjectEntry projectEntryGraph = PXGraph.CreateInstance <ProjectEntry>();

                    foreach (var field in projectEntryGraph.GetFieldNames(SmartsheetConstants.ViewName.TASK))
                    {
                        if (ignoredFields.Any(fieldName => field.Contains(fieldName) || field.Contains("_") || field.Contains("Note")))
                        {
                            continue;
                        }
                        if (!values.Contains(field))
                        {
                            PXFieldState fs = projectEntryGraph.Caches[type].GetStateExt(null, field) as PXFieldState;
                            values.Add(field);
                            labels.Add(fs != null ? fs.DisplayName : field);
                        }
                    }
                    _values = values.ToArray();
                    _labels = labels.ToArray();
                }
Beispiel #2
0
        public override void CacheAttached(PXCache sender)
        {
            base.CacheAttached(sender);

            var values = new List <string>()
            {
                " "
            };
            var labels = new List <string>()
            {
                " "
            };

            var type = typeof(PMTask);

            // Acuminator disable once PX1045 PXGraphCreateInstanceInEventHandlers Needed because the info is retrieved using a graph instance.
            if (PXAccess.FeatureInstalled <FeaturesSet.projectModule>())
            {
                ProjectEntry projectEntryGraph = PXGraph.CreateInstance <ProjectEntry>();
                foreach (var field in projectEntryGraph.GetFieldNames(SmartsheetConstants.ViewName.TASK))
                {
                    if (ignoredFields.Any(fieldName => field.Contains(fieldName) || field.Contains("_") || field.Contains("Note")))
                    {
                        continue;
                    }
                    if (!values.Contains(field))
                    {
                        PXFieldState fs = projectEntryGraph.Caches[type].GetStateExt(null, field) as PXFieldState;
                        values.Add(field);
                        labels.Add(fs != null ? fs.DisplayName : field);
                    }
                }
            }

            _AllowedValues = values.ToArray();
            _AllowedLabels = labels.ToArray();
        }