Hello I’m hoping someone can point me in the right direction on this. I’m trying to create templates in a new environment that will pre-populate Accounts ans Sub Accounts based on the Template Selected. We are using Payroll and 2023R1. The fields:
- PMProject.BenefitExpenseAcctID
- PMProject.BenefitExpenseSubID
- PMProject.EarningsAcctID
- PMProject.EarningsSubID
- PMProject.TaxExpenseAcctID
- PMProject.TaxExpenseSubID
Are all available on the form but not populating when I select the Template. I have customized the Project Properties but when I unpublished the customization's it is still not working.
In ProjectEntry.cs I did find a section that seems to be listing the items to copy but I’m not sure how to add things to it. Any help would be great I have tried to follow other examples of people working with this but nothing seems to work. Below is the code from the Handler.
public virtual void DefaultFromTemplateProjectSettings(PMProject prj, PMProject templ)
{
prj.Description = templ.Description;
PXDBLocalizableStringAttribute.CopyTranslations<PMProject.description, PMProject.description>
(Caches[typeof(PMProject)], templ, Caches[typeof(PMProject)], prj);
prj.BudgetLevel = templ.BudgetLevel;
prj.CostBudgetLevel = templ.CostBudgetLevel;
prj.AccountingMode = templ.AccountingMode;
prj.TermsID = templ.TermsID;
prj.AutoAllocate = templ.AutoAllocate;
prj.LimitsEnabled = templ.LimitsEnabled;
prj.PrepaymentEnabled = templ.PrepaymentEnabled;
prj.PrepaymentDefCode = templ.PrepaymentDefCode;
prj.DefaultBranchID = templ.DefaultBranchID;
prj.DefaultSalesAccountID = templ.DefaultSalesAccountID;
prj.DefaultSalesSubID = templ.DefaultSalesSubID;
prj.DefaultExpenseAccountID = templ.DefaultExpenseAccountID;
prj.DefaultExpenseSubID = templ.DefaultExpenseSubID;
prj.DefaultAccrualAccountID = templ.DefaultAccrualAccountID;
prj.DefaultAccrualSubID = templ.DefaultAccrualSubID;
prj.CalendarID = templ.CalendarID;
prj.RestrictToEmployeeList = templ.RestrictToEmployeeList;
prj.RestrictToResourceList = templ.RestrictToResourceList;
prj.AllowOverrideCury = templ.AllowOverrideCury;
prj.AllowOverrideRate = templ.AllowOverrideRate;
prj.RateTableID = templ.RateTableID;
prj.AllocationID = templ.AllocationID;
prj.BillingID = templ.BillingID;
prj.ApproverID = templ.ApproverID;
prj.OwnerID = templ.OwnerID;
prj.AutomaticReleaseAR = templ.AutomaticReleaseAR;
prj.CreateProforma = templ.CreateProforma;
prj.ChangeOrderWorkflow = templ.ChangeOrderWorkflow;
prj.RetainagePct = templ.RetainagePct;
prj.BudgetMetricsEnabled = templ.BudgetMetricsEnabled;
prj.IncludeCO = templ.IncludeCO;
prj.RetainageMaxPct = templ.RetainageMaxPct;
prj.RetainageMode = templ.RetainageMode;
prj.SteppedRetainage = templ.SteppedRetainage;
prj.AIALevel = templ.AIALevel;
prj.LastProformaNumber = templ.LastProformaNumber;
prj.IncludeQtyInAIA = templ.IncludeQtyInAIA;
prj.DropshipExpenseAccountSource = templ.DropshipExpenseAccountSource;
prj.DropshipExpenseSubMask = templ.DropshipExpenseSubMask;
prj.DropshipReceiptProcessing = templ.DropshipReceiptProcessing;
prj.DropshipExpenseRecording = templ.DropshipExpenseRecording;
prj.VisibleInAP = templ.VisibleInAP;
prj.VisibleInGL = templ.VisibleInGL;
prj.VisibleInAR = templ.VisibleInAR;
prj.VisibleInSO = templ.VisibleInSO;
prj.VisibleInPO = templ.VisibleInPO;
prj.VisibleInTA = templ.VisibleInTA;
prj.VisibleInEA = templ.VisibleInEA;
prj.VisibleInIN = templ.VisibleInIN;
prj.VisibleInCA = templ.VisibleInCA;
prj.VisibleInCR = templ.VisibleInCR;
ContractBillingSchedule billing = PXSelect<ContractBillingSchedule, Where<ContractBillingSchedule.contractID, Equal<Current<PMProject.contractID>>>>.SelectSingleBound(this, new object[] { templ });
if (billing != null)
{
if (Billing.Current == null)
{
Billing.Current = Billing.Select();
}
if (Billing.Current != null)
{
Billing.SetValueExt<ContractBillingSchedule.type>(Billing.Current, billing.Type);
Billing.Update(Billing.Current);
}
}
}