Skip to main content
Question

Labor Item Selection Based on Earning Type

  • November 24, 2023
  • 0 replies
  • 91 views

Sagar Greytrix
Captain II
Forum|alt.badge.img+3

Hi Team,

 

I want to display only values in the labor item field selector where the earning type is selected as 'BILLABLE' on the summary tab of the 'Employee Time Card' screen. I have written the code for this, but it's not working. Kindly provide me with a solution so that I can achieve this.


 

 #region LabourItemID  
public new abstract class labourItemID : PX.Data.BQL.BqlInt.Field<labourItemID> { }
[PMLaborItem(typeof(projectID), typeof(earningType), typeof(Select<EPEmployee, Where<EPEmployee.bAccountID,
Equal<Null>>>))]
[PXSelector(typeof(Search<InventoryItem.inventoryID, Where<InventoryItem.itemClassID,
In2<Search<INItemClass.itemClassID, Where
<INItemClass.itemClassCD, Equal<Current<EPTimeCardSummaryWithInfo.earningType>>>>>,
And<CustomerClassAttr.EarningType, Equal<Current<EPTimeCardSummaryWithInfo.earningType>>>>>),
SubstituteKey = typeof(InventoryItem.inventoryCD),
DescriptionField = typeof(InventoryItem.descr)
)]
[PXCustomizeSelectorColumns(
typeof(PX.Objects.IN.InventoryItem.inventoryCD),
typeof(PX.Objects.IN.InventoryItem.descr),
typeof(PX.Objects.IN.InventoryItem.itemClassID),
typeof(PX.Objects.IN.InventoryItem.itemStatus),
typeof(PX.Objects.IN.InventoryItem.itemType),
typeof(PX.Objects.IN.InventoryItem.baseUnit),
typeof(PX.Objects.IN.InventoryItem.salesUnit),
typeof(PX.Objects.IN.InventoryItem.purchaseUnit),
typeof(PX.Objects.IN.InventoryItem.basePrice))]
public int? LabourItemID { get; set; }

public class CustomerClassAttr
{
public class EarningType : BqlType<IBqlString, string>.Constant<EarningType>
{
public EarningType() : base("BILLABLE") { }
}
}
#endregion
}
}

 

Regards,

Sagar