Skip to main content
Solved

Document User Defined Fields

  • 10 June 2024
  • 1 reply
  • 44 views

I added some User Defined Fields on the Purchase Order document, however once I put the document to the open status these UDF are longer editable (same as other fields in the document header), I wonder if there is a solution for this, I need to edit these fields even when the document is in the open status.

1 reply

Userlevel 7
Badge +9

This should do the work @Pinny 

Leave the two graph extensions in your extension so your code overrides the Workflow and Approval engine UI manipulations and of course, you need to modify the code based on the extension and udf fields you have added.

 

using PX.Data;
using PX.Objects.PO;

namespace HCL
{
public class HCLPOOrderEntryWF : PXGraphExtension<POOrderEntry_ApprovalWorkflow, POOrderEntry_Workflow, POOrderEntry>
{
public static bool IsActive() => true;

protected virtual void _(Events.RowSelected<POOrder> e)
{
if (e.Row == null) return;
PXUIFieldAttribute.SetEnabled<HCLPOOrderWF.usrHCLApprovalRouteID>(e.Cache, e.Row, true);
e.Cache.AllowUpdate = true; // you may need this line to be able to save but first try without this line
}
}
}

 

Reply