在Acumatica中,要隐藏项目-摘要选项卡中的字段,可以使用以下代码示例来解决:
public class MyGraphExtension : PXGraphExtension
{
#region Event Handlers
protected void YourDACField_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
YourDACField row = (YourDACField)e.Row;
if (row != null)
{
PXUIFieldAttribute.SetVisible(cache, row, false);
}
}
#endregion
}
public class YourDACField : PXCacheExtension
{
#region UsrYourField
[PXBool]
[PXUIField(DisplayName = "Your Field")]
public virtual bool? YourField { get; set; }
public abstract class yourField : PX.Data.BQL.BqlBool.Field { }
#endregion
}
public class YourPageClassNameExtension : PXGraphExtension
{
#region Initialize
public override void Initialize()
{
base.Initialize();
Base.Caches[typeof(PX.Objects.PM.PMProject)].Fields.Add("UsrYourField");
Base.RowSelected.AddHandler(YourField_RowSelected);
}
#endregion
#region Event Handlers
protected void YourField_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
YourDACField row = (YourDACField)e.Row;
if (row != null)
{
PXUIFieldAttribute.SetVisible(cache, row, false);
}
}
#endregion
}
请确保将上述代码中的“YourGraphClassName”、“YourDACField”、“YourField”、“YourPageClassName”替换为您实际使用的类名和字段名。
这样,当您打开项目-摘要选项卡时,该字段将被隐藏。