My selector returns no data when I try to restrict the results to the WorkgroupID field of the current record.
If I don’t try to restrict the selector with the current Workgroup value, it returns all records in my custom table, whereas I only want it to return records from the custom table where the WorkgroupID is the same as what was selected on the grid.
These are the UDF’s on the PMTimeActivity table. They all save to the PMTimeActivity table and function correctly otherwise.
This is the Selector for the UsrProductID field.
#region UsrProductID
[PXDBInt]
[PXUIField(DisplayName = "Product Code")]
[PXSelector(typeof(SearchFor<ICSProductCode.productID>.
Where<ICSProductCode.active.IsEqual<True>.
And<ICSProductCode.workgroupID.IsEqual<EPTimecardDetail.workgroupID.FromCurrent>>>),
typeof(ICSProductCode.productCD),
typeof(ICSProductCode.description),
SubstituteKey = typeof(ICSProductCode.productCD),
DescriptionField = typeof(ICSProductCode.description))]
public int? UsrProductID { get; set; }
public abstract class usrProductID : PX.Data.BQL.BqlInt.Field<usrProductID> { }
#endregion
If I remove the And<ICSProductCode.workgroupID.IsEqual<EPTimecardDetail.workgroupID.FromCurrent»
the selector returns all data from my custom table (which I would expect).
The custom table has a key fleid WorkgroupID. I only want to return records in the selector where the workgroupID matches the WorkgroupID selected on the current line.
I know that the EPTimecardDetail.workgroupID for the current line has a value of 1.
I know this because in debug, the wgID has a value of one on the rowselected event.
protected virtual void _(Events.RowSelected<EPTimecardDetail> e)
{
EPTimecardDetail row = e.Row;
if (row == null) return;
int? wgID = row.WorkgroupID;
}
I don’t know why my EPTimecardDetail.workgroupID.FromCurrent is not evaluating to only show records from my custom table with WorkgroupID of 1.
I attached the DAC, DAC Extension and Graph Extension if you want to see more details.
Note that if I do not try to restrict the selector to the WorkgroupID of the current record, I can select and save data to the tables.
This screen is very confusing as the DAC and Graph seem to make references to other classes almost as if they were nested.
This is the data in my tables so you can see there is a value to join to