Skip to main content
Solved

Custom project task selector based on the selected custom project.


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

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) { }
    }
}

Best answer by Sagar Greytrix

I have resolved the issue.

View original
Did this topic help you find an answer to your question?

2 replies

Sagar Greytrix
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • 112 replies
  • Answer
  • January 7, 2025

I have resolved the issue.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2756 replies
  • January 8, 2025

Hi ​@Sagar Greytrix - Can you share with the community what your solution was? Thank you!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings