We have a project that is not yet approved, however there are already commitments (Purchase Orders) against it. We don’t want Purchase Orders to be issued to suppliers before the project is approved. How do we stop it, is there a setting somewhere?
Answer
Project Commitments added before approval
Best answer by noorula77
Check with setting Approval Project Preference screen or try with customization.
protected void POLine_ProjectID_FieldVerifying(PXCache cache, PXFieldVerifyingEventArgs e)
{
POLine row = (POLine)e.Row;
if (row != null && row.ProjectID != null)
{
PMProject project = PXSelect<PMProject,
Where<PMProject.contractID, Equal<Required<PMProject.contractID>>>>.Select(Base, row.ProjectID);
if (project != null && project.Status != ProjectStatus.Approved)
{
throw new PXSetPropertyException("Purchase Orders cannot be created for unapproved projects.");
}
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.