Skip to main content
Question

How to solve the following error: GenericArguments[0], 'AddFilterOnProjectTaskWeekly.ProjTaskAttribute+CONTAINS_LABOUR', on 'PX.Data.Current`1[Field]' violates the constraint of type parameter 'Field'.

  • November 30, 2023
  • 0 replies
  • 133 views

Forum|alt.badge.img
public class ProjTaskAttribute : ProjectTaskAttribute
    {
        public const string Labor = "LABOR";
        public ProjTaskAttribute(Type projectID) : base(projectID)
        {

            Type Labor = typeof(CONTAINS_LABOUR);
            Type SearchType =
                BqlCommand.Compose(
                typeof(Search<,>),
                typeof(PMTask.taskID),
                typeof(Where<,,>),typeof(PMTask.projectID),typeof(Equal<>),typeof(Current<>),projectID,
                typeof(And<,>),typeof(PMTask.description),typeof(Like<>),typeof(Current<>), Labor
                );

            PXDimensionSelectorAttribute select = new PXDimensionSelectorAttribute(DimensionName, SearchType, typeof(PMTask.taskCD),
                         typeof(PMTask.taskCD), typeof(PMTask.description), typeof(PMTask.status));
            select.DescriptionField = typeof(PMTask.description);
            select.ValidComboRequired = true;

            _Attributes.Add(select);
            _SelAttrIndex = _Attributes.Count - 1;

            Filterable = true;
        }

        public sealed class CONTAINS_LABOUR : BqlType<IBqlString, string>.Constant<CONTAINS_LABOUR>
        {
            /// <exclude/>
            public CONTAINS_LABOUR() : base("LABOR") { }
        }
    }

How to solve the following error: GenericArguments[0], 'AddFilterOnProjectTaskWeekly.ProjTaskAttribute+CONTAINS_LABOUR', on 'PX.Data.Current`1[Field]' violates the constraint of type parameter 'Field'.

 

 

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings