I am trying to add an Employees selector to the Journal Transactions screen (GL301000) specifically in the grid. I have created the DAC extension code using the GLTran DAC as the base. Here is my code:
using PX.Common;
using PX.Data.ReferentialIntegrity.Attributes;
using PX.Data;
using PX.Objects.AP;
using PX.Objects.CM;
using PX.Objects.CR;
using PX.Objects.CS;
using PX.Objects.EP;
using PX.Objects.GL;
using PX.Objects.IN;
using PX.Objects.PM;
using PX.Objects.TX;
using PX.Objects;
using System.Collections.Generic;
using System;
namespace PX.Objects.GL
{
public class GLTranExt : PXCacheExtension<PX.Objects.GL.GLTran>
{
#region Resource
public class emp: PX.Data.Constant<string>
{
public emp() : base("EMPHOUR") { }
}
public abstract class resource: PX.Data.IBqlField
{
}
protected int? _Resource;
[PXDBInt]
[PXDefault()]
[PXUIField(DisplayName="Resource")]
[PXSelector(typeof(Search2<BAccount.bAccountID,
InnerJoin<Vendor,
On<Vendor.bAccountID,
Equal<BAccount.bAccountID>>>,
Where<Vendor.vendorClassID,
Equal<emp>>>),
SubstituteKey = typeof(BAccount.acctName))]
public virtual int? Resource
{
get
{
return this._Resource;
}
set
{
this._Resource = value;
}
}
#endregion
}
}
I am getting an error when I try to add the field to the grid and this is my error:
Error: An invalid selector column has been provided.
Parameter name: fieldList
Can anyone point me in the right direction? I do know that to get the correct Employee's names to show up you must use a where or join on the Vendor table and the BAccount tables. When I tried the LeftJoin method however, I got an error saying multi-part identifier could not be bound.
SearchtoSearch2and write the query with Join. - Samvel Petrosov