Hi Team,
I have created custom project and task selector fields on the request screen.
Currently, the selector displays all tasks, but I want it to display only the tasks related to the selected project in the task lookup.
Please assist me in resolving this issue.
Below is the code.
#region UsrProject
[PXString(255)]
[PXUIField(DisplayName = "Project", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(typeof(Search2<PMProject.contractCD,
LeftJoin<Customer, On<Customer.bAccountID, Equal<PMProject.customerID>>,
LeftJoin<ContractBillingSchedule, On<ContractBillingSchedule.contractID, Equal<PMProject.contractID>>>>,
Where<PMProject.baseType, Equal<CTPRType.project>,
And<PMProject.nonProject, Equal<False>,
And<PMProject.status, Equal<ProjectStatus.active>>>>>),
typeof(PMProject.contractCD), typeof(PMProject.description),
typeof(PMProject.customerID), typeof(PMProject.customerID_Customer_acctName), typeof(PMProject.locationID), typeof(PMProject.status),
typeof(PMProject.ownerID), typeof(PMProject.startDate), typeof(ContractBillingSchedule.lastDate), typeof(ContractBillingSchedule.nextDate), typeof(PMProject.defaultSalesSubID),
DescriptionField = typeof(PMProject.description))]public virtual string UsrProject { get; set; }
public abstract class usrProject : PX.Data.BQL.BqlString.Field<usrProject> { }
#endregion
#region UsrProjectTask
[PXString(255)]
[PXUIField(DisplayName = "Project Task", Visibility = PXUIVisibility.SelectorVisible)]
[PXSelector(
typeof(Search2<PMTask.taskCD,
InnerJoin<PMProject, On<PMTask.projectID, Equal<PMProject.contractID>>>,
Where<PMTask.status, Equal<PMTaskStatus1.active1>,
And<PMProject.contractCD, Equal<Current<RQRequestExt.usrProject>>>>>),
typeof(PMTask.taskCD),
typeof(PMTask.description),
typeof(PMTask.locationID),
typeof(PMTask.status),
DescriptionField = typeof(PMTask.description))]public virtual string UsrProjectTask { get; set; }
public abstract class usrProjectTask : PX.Data.BQL.BqlString.Field<usrProjectTask> { }
#endregion
}
public static class PMTaskStatus1
{
public const string Active1 = "A";
public class active1 : PX.Data.BQL.BqlString.Constant<active1>
{
public active1() : base(Active1) { }
}
}