Nicolas Antoine
Nicolas Antoine

Reputation: 43

Acumatica hide drop-down and define default value

On Screen FA303000, tab ACTIONS -> Dispose.

I would like to hide the "Before disposal" drop down and define the "Depreciate" action by default. I tried to customize the attributes but without success.

Code :

    public class FA_DisposeParams_Ext : PXCacheExtension<PX.Objects.FA.DisposeParams>
  {
   [PXMergeAttributes(Method = MergeMethod.Append)]
    [PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), "Visible", false)]
    [PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), "Visibility", PXUIVisibility.Invisible)]
    [PXCustomizeBaseAttribute(typeof(PXDefaultAttribute), "Constant", "D")]
      public string ActionBeforeDisposal { get; set; }
}

enter image description here

Upvotes: 0

Views: 182

Answers (1)

Patrick Chen
Patrick Chen

Reputation: 1056

You should try setting visibility on initialize in your graph extension. Something like the following:

public override void Initialize()
    {
        PXCache cache = Base.Packages.Cache;
        PXUIFieldAttribute.SetVisible<SOPackageDetail.createdByID>(cache, null, false);
    }

Upvotes: 2

Related Questions