When I add a field to the ts PXView I get the following error.
Sequence contains more than one matching element
All other fields work as expected except the Template field. I am assuming it has something to do with the PXSelector but am not sure.
Below is the PXView def
@gridConfig({
preset: GridPreset.Details,
syncPosition: true
})
export class Inspections extends PXView {
CreateInspection: PXActionState;
DocDate: PXFieldState;
ProjectTask: PXFieldState;
InspectionCD: PXFieldState;
Template: PXFieldState;
}
snippet from DAC defining template
#region Template
[PXDBInt]
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXForeignReference(typeof(FK.Template))]
[PXUIField(DisplayName = "Type", Visibility = PXUIVisibility.SelectorVisible, Required = true)]
[PXSelector(
typeof(Search2<GPProjectInspectionTemplate.templateID,
LeftJoin<GPProjectInspectionTemplateAssociations, On<GPProjectInspectionTemplateAssociations.FK.Template>,
LeftJoin<Contract, On<Contract.contractID, Equal<Current<project>>>,
LeftJoin<PMTask, On<PMTask.taskID, Equal<Current<projectTask>>>,
LeftJoin<GPEstimateTask, On<GPEstimateTask.taskCD, Equal<PMTask.taskCD>>>
>
>
>
,
Where<
GPProjectInspectionTemplate.active, Equal<True>,
And<Where<GPProjectInspectionTemplate.restrictUseToAssociations, Equal<False>,
Or<Where<
Where<GPProjectInspectionTemplate.restrictUseToAssociations, Equal<True>,
And<Contract.templateID, Equal<GPProjectInspectionTemplateAssociations.projectTemplate>,
And<GPProjectInspectionTemplateAssociations.taskID, IsNull,
Or<GPEstimateTask.estimateTaskID, Equal<GPProjectInspectionTemplateAssociations.taskID>>>
>>
>
>
>
>
>
,
OrderBy<Desc<GPProjectInspectionTemplate.templateCD>>>),
new Type[] {
typeof(GPProjectInspectionTemplate.templateCD),
///typeof(GPProjectInspectionTemplate.crewType),
typeof(GPProjectInspectionTemplate.description)
},
SubstituteKey = typeof(GPProjectInspectionTemplate.templateCD),
DescriptionField = typeof(GPProjectInspectionTemplate.description))]
public virtual int? Template { get; set; }
public abstract class template : PX.Data.BQL.BqlInt.Field<template> { }
#endregion
Also the field works fine in the classic UI