Reputation: 291
When upgrading from Acumatica ERP 5.3 to 17.2, I ran into an issue because the ActiveProject* attribute classes no longer exist. Does anyone have any suggestions for adapting our customized code using these attributes (e.g. ActiveProjectForModuleAttribute) on a project id to work in R2? Is there a new preferred way to accomplish what this class used to?
Upvotes: 0
Views: 218
Reputation: 6778
What I usually do is compare the code file from the previous version with the same code file from the newer build. This is quite straightforward because the entire source code of PX.Objects.dll is stored inside Acumatica website's \App_Data\CodeRepository\PX.Objects folder.
In your case, you only need to install locally one Acuamtica ERP 5.3 website and one Acuamtica ERP 2017 R2 website, then search in Visual Studio for ActiveProjectForModuleAttribute inside your 5.3 website's \App_Data\CodeRepository\PX.Objects folder and compare the search results with 2017 R2 code base.
Just to give an example, in ver 5.3 the ActiveProjectForModuleAttribute was used on the ProjectID field of the POLine:
[System.SerializableAttribute()]
[PXCacheName(Messages.POLineShort)]
public partial class POLine : PX.Data.IBqlTable, IAPTranSource, IItemPlanMaster, ISortOrder
{
...
#region ProjectID
public abstract class projectID : PX.Data.IBqlField
{
}
protected Int32? _ProjectID;
[POProjectDefault(typeof(POLine.lineType), AccountType = typeof(POLine.expenseAcctID))]
[ActiveProjectForModule(BatchModule.PO, null, false, false, true)]
public virtual Int32? ProjectID
{
get
{
return this._ProjectID;
}
set
{
this._ProjectID = value;
}
}
#endregion
...
}
In 2017 R2 ActiveProjectForModuleAttribute was replaced with the ProjectBaseAttribute and 2 PXRestrictor attributes:
[System.SerializableAttribute()]
[PXCacheName(Messages.POLineShort)]
public partial class POLine : PX.Data.IBqlTable, IAPTranSource, IItemPlanMaster, ISortOrder
{
...
#region ProjectID
public abstract class projectID : PX.Data.IBqlField
{
}
protected Int32? _ProjectID;
[POProjectDefault(typeof(POLine.lineType), AccountType = typeof(POLine.expenseAcctID))]
[PXRestrictor(typeof(Where<PMProject.isCancelled, Equal<False>>),
PM.Messages.CancelledContract, typeof(PMProject.contractCD))]
[PXRestrictor(typeof(Where<PMProject.visibleInPO, Equal<True>,
Or<PMProject.nonProject, Equal<True>>>),
PM.Messages.ProjectInvisibleInModule, typeof(PMProject.contractCD))]
[ProjectBaseAttribute()]
public virtual Int32? ProjectID
{
get
{
return this._ProjectID;
}
set
{
this._ProjectID = value;
}
}
#endregion
...
}
Upvotes: 2