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'.

  • 30 November 2023
  • 0 replies
  • 46 views

Userlevel 1
Badge
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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved