Hi Experts,
I am working on a couple of things to include all Business Accounts in the selection on Projects (PM301000) screen. As of now only customers are displayed under selector of Business Accounts.
I have tried the standard code as below.
[PXDBInt]
[PXDimensionSelector("BIZACCT", typeof(BAccount.bAccountID), substituteKey: typeof(BAccount.acctCD), DescriptionField = typeof(BAccount.acctName))]
[PXUIField(DisplayName = "Business Account", Visibility = PXUIVisibility.SelectorVisible)]
I have tried below workaround to achieve the same but unable to get the desired outcome on the Projects screen.
#region Usrbaccount
[PXDBInt]
[PXUIField(DisplayName = "Business Account")]
[PXSelector(typeof(Search<BAccount.acctCD,
Where<BAccount.type, Equal<ContractExt.HardCodeValues.VE>,
Or<BAccount.type, Equal<ContractExt.HardCodeValues.CP>,
Or<BAccount.type, Equal<ContractExt.HardCodeValues.CU>,
Or<BAccount.type, Equal<ContractExt.HardCodeValues.EP>,
Or<BAccount.type, Equal<ContractExt.HardCodeValues.OR>,
Or<BAccount.type, Equal<ContractExt.HardCodeValues.PR>>>>>>>>),
typeof(BAccount.acctName),
DescriptionField = typeof(BAccount.acctName))]
public virtual int? Usrbaccount { get; set; }
public abstract class usrbaccount : PX.Data.BQL.BqlInt.Field<usrbaccount> { }
#endregion
public static class HardCodeValues
{
public class VE : BqlType<IBqlString, string>.Constant<VE>
{
public VE() : base(value: "VE")
{
}
}
public class CP : BqlType<IBqlString, string>.Constant<CP>
{
public CP() : base(value: "CP")
{
}
}
public class CU : BqlType<IBqlString, string>.Constant<CU>
{
public CU() : base(value: "CU")
{
}
}
public class EP : BqlType<IBqlString, string>.Constant<EP>
{
public EP() : base(value: "EP")
{
}
}
public class OR : BqlType<IBqlString, string>.Constant<OR>
{
public OR() : base(value: "OR")
{
}
}
public class PR : BqlType<IBqlString, string>.Constant<PR>
{
public PR() : base(value: "PR")
{
}
}
}
However, when I attempted to run the both logic on the Business Accounts screen, it worked as expected. On the other hand, when I tried it on the Employee Time Cards screen, it only displayed employees in the selector.
I believe this behavior is occurring due to the restrictions imposed on the screens. Am I correct or anyone else have an idea to achieve the same?
Thanks!
Best answer by Zoltan Febert
View original